-
PHP
(
https://www.0058.net/forumdisplay.php?f=75)
| Unionville Center |
2016-02-21 04:35 PM |
Php查询mysql, 显示一维数组
Code:
<?php
$con = mysql_connect("localhost","username","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$db_selected = mysql_select_db("database",$con);
$sql = "SELECT * from table WHERE mobile='11111111111'";
$result = mysql_query($sql,$con);
//print_r(mysql_fetch_array($result));
$info= mysql_fetch_array($result);
echo $info[1];
mysql_close($con);
?>
|
| All times are GMT +8. The time now is 03:04 AM. |
|
Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.