ÓÃPHPÅÅÐòmysqlÎÊÌâ
²»ÖªµÀÊDz»ÊÇÎÒµÄxamppÓÐÎÊÌ⣬mysqlÊÇͼÐλ¯µÄ£¡
Ò»¸öID×éÔÚÎÒµÄmysqlµÄ±íÀïÃæ 2£¬5£¬8£¬7
µãÁËÅÅÐò£¬È»ºóÓÃPHPÎļþÁ¬½ÓÕâ¸ö±íÏÔʾ±íµÄÐÅϢʱ£¬IDµÄ˳Ðò»¹ÊDz»±ä£¡Ó¦¸ÃÊÇ2£¬5£¬7£¬8µÄ°ÉÉýÐòÅÅÐòºó£¡
ÔÚPHPÎļþÀïÓÃPHP code:
$sql="SELECT * from retabs ORDER BY num asc";
$results=mysql_query($sql)
or die("ÅÅÐòʧ°Ü".mysql_error);
Ò²²»ÐУ¡ÓôÃÆËÀÁË£¡Ò²²»ÌáʾÅÅÐòʧ°Ü£¡
ÇëÎÊÕâ¸öÊÇÔõô»ØÊ°¡£¿
лл´ó¼ÒÁË
PHP code:
ÄãÒª°´IDÅÅÐòÓ¦¸ÃÊÇ£º
select * from retabs order by id;
¶î »Ø¶þÂ¥µÄ£¡ÎÒÄÇÅÅID×éËù¶ÔÓ¦µÄÃû×ÖÊÇnum£¬ºÇºÇ£¡
ÎÒµÄÓ﷨û´íµÄ
˰ﶥÏ°¡ ллÁË
Äã°Ñ´íÎóÐÅÏ¢´òÓ¡³öÀ´¿´¿´
SQL code:
$sql="SELECT * from `retabs` ORDER BY `num` ASC";
¿´ÄãµÄÓï¾ä£¬Ó¦¸ÃûÓдíµÄ
ÄÇÄã°ÑID×éÉèÖóÉ×ÔÔöÀàÐÍ
SQL code:
alter table retable change num int auto_increment primary key
ÄãÓ¦¸Ã³¢ÊÔʹÓÃmysqlµÄÃüÁîÐÐÖвâÊÔÄãµÄsqlÓï¾äÓÐûÓÐÎÊÌâ¡£
Èç¹ûûÓÐÄã¾ÍÓ¦¸ÃÈ¥ÏëÏëÆäËûµØ·½µÄÎÊÌâ¡£
ÅÅÐòµ
Ïà¹ØÎÊ´ð£º
<?php
getenv("ORACLE_HOME");
$conn=ocilogon("test","test","test_db");
if($conn)
echo success;
&nb ......
¸÷λ´óÏÀ
ÇóÒ»¶Îphp´úÂë
¿ÉÒÔʵÏÖÒÔϹ¦ÄÜ
Õë¶Ô²»Í¬µÄä¯ÀÀÆ÷ÏÔʾ²»Í¬µÄͼƬ
¾ÍÊÇÓÐÒ»ÕÅͼƬ£¬Ö»Ïë¸øie6Óû§¿´µ½
Èç¹ûie7¡¢chrome¡¢firefoxÓû§ä¯ÀÀÔòÏÔʾÁíÍâÒ»ÕÅͼƬ  ......
ÀýÈçÒ»¾äÎı¾ AAA'BBB\CCC
ÓÃÁË mysql_real_escape_string ºó ¿ÉÒÔ´æ½øÊý¾Ý¿â
µ«¶Á³öÀ´µÄʱºò£¬¾Í³ÉÁË
AAA\'BBB\\\CCC
ÈçºÎ»¹ÔΪ AAA'BBB\CCC
addslashes
stripslashes
[b][/b]ÒýÓÃ
adds ......
ÎÒÊÇÓÃmysql×Ô´øµÄC API
if(mysql_real_connect(&mysql,"125.0.0.108","root","root","home",3306,NULL,0))
{
AfxMessageBox("Êý¾Ý¿âÁ¬½Óʧ°Ü") ......
ÔÚ°²×°Java±àÒëÆ÷µÄEclipseµÄʱºò£¬¶Ô»·¾³±äÁ¿½øÐÐÁËÅäÖã¬ÔÚ°²×°MySQlµÄʱºòÒ²Òª¶Ô»·¾³±äÁ¿½øÐÐÅäÖã»ÄÇôºóÃæµÄÅäÖûáÓ°ÏìÇ°ÃæµÄEclipseµÄÅäÖÃÂð£¿
Çë´ó¼Ò¶àÖ¸½Ì~£¡Ð»Ð»£¡
²»»á°Ñ£¬ÎÒÕⶼװÁ赀 ÎÒϵͳÀï »¹×°ÁË ......