woff 發表於 2009-7-18 01:01:17

建資料庫&query出Mysql資料

CREATE TABLE `test` ( `id` VARCHAR( 10 ) NOT NULL , `num` INT NOT NULL )

insert into test(id,num) values('abc',1);


<?PHP
mysql_connect("localhost","user","password");
mysql_select_db("test");
$query="select * from test where id = 'abc'";
$rows = mysql_query($query);
$row = mysql_fetch_array($rows);
print_r($row);
echo "<br>";
echo $row['id'];
?>
頁: [1]
查看完整版本: 建資料庫&query出Mysql資料