Re-ask: Why does the jump past page not show the data just inserted?

Source: Internet
Author: User
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 '
?>

















foreach ($list as $v) {echo ' '; Echo ' '; Echo ' '; Echo ' '; Echo ' '; Echo ' '; }?>
School Number Name Age
'. $v [' id ']. ''. $v [' name '], ''. $v [' num ']. 'Edit




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.
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.