A separate open Query data page can be displayed but jumping past is not showing the data just inserted who can help me on my own machine to try the code this problem for a few days, it's not solved, it's almost collapsed.
Submit data. html
insert2.php
$con = mysql_connect ("localhost", "root", "");
if (! $con)
{
Die (' Could not connect: '. Mysql_error ());
}
mysql_select_db ("T1", $con);
$sql = "INSERT into Stu (ID, name, num)
VALUES (' $_post[firstname] ', ' $_post[lastname] ', ' $_post[age] ') ";
if (!mysql_query ($sql, $con))
{
Die (' Error: '. mysql_error ());
}
echo "";
Mysql_close ($con)
?>
cx.php
$con = mysql_connect ("localhost", "root", "");
if (! $con)
{
echo "Failed to connect to database";
Exit
}
$sql = ' Use T1 ';
mysql_query ($sql, $con);
$sql = ' Select*from stu ';
$rs =mysql_query ($sql, $con);
$list =array ();
while ($row =mysql_fetch_assoc ($rs)) {
$list []= $row;
}
Echo ' $sql '
?>
| School Number |
Name |
Age |
foreach ($list as $v) {echo '
'; Echo '
| '. $v [' id ']. ' | '; Echo '
'. $v [' name '], ' | '; Echo '
'. $v [' num ']. ' | '; Echo '
Edit | '; Echo '
'; }?>
Reply to discussion (solution)
(' $_post[firstname] ', ' $_post[lastname] ', ' $_post[age] '), array index unquoted
In cx.php Print_r ($list); See if there's any value.
In addition, you can see in the browser cx.php source of the output of a few lines.
No problem!
Should be your browser cache settings problem, try a different browser
No problem!
Should be your browser cache settings problem, try a different browser
There's a problem with Chinese.
No problem!
Should be your browser cache settings problem, try a different browser
There's a problem. I changed my browser. 360 killed people.