PHP can not modify the data to solve the idea

Source: Internet
Author: User
PHP Cannot modify data
I'm just a beginner PHP, I hope you teachers ask



if ($_get["type"]== "modify") {

$id =$_get[' id '];
if ($_post["SUBMIT3"])
{
$sql = "Update t_user set f_username= ' $a ', f_sex= ' $b ', f_age= ' $c ', f_ct= ' $d ', f_zaoyingji= ' $f ', f_buwei= ' $g ', f_hu= ' $h ', F _jishu= ' $i ', f_xiaoaguo= ' $j ', f_qianming= ' $k ', f_yanchi_time= ' $l ', f_chufa_time= ' $m ' where id= $id ';
mysql_query ($sql);
echo "";
}
$sql = "SELECT * from T_user where id= $id";
$rs =mysql_query ($sql);
$ros =mysql_fetch_row ($RS);
?>
$result = $connection->query ("select * from T_user where id= $id limit 1");
while ($rws = $result->fetch_row ()) {
?>
}
?>

------Solution--------------------
$rs =mysql_query ($sql) or Die (Mysql_error ()); It's a mistake to change the sentence into this way.
------Solution--------------------
PHP said you did not select the database, that is, you did not select the database!
------Solution--------------------
mysql_select_db () How is this set?
------Solution--------------------
You use mysqli to connect to the database
But with mysql_query ($sql); manipulating databases
What can I do with this whole thing?

Although MySQL extensions and mysqli extensions are used to manipulate MySQL databases
But they are two different sets of things that can't be mixed!
  • 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.