Jump to content

Perform A Query


yangkai9999
 Share

Recommended Posts

Hello,I wrote a code like this:<?phpif (!isset($_POST['getid'])) ( $chk=$_POST["getid"] ) ;$chk=$_POST["getid"];$hostname='localhost';$user='root';$pass='Openit4me';$dbase='mytest';$connection = mysql_connect("$hostname" , "$user" , "$pass") or die ("Can't connect to MySQL");$db = mysql_select_db($dbase , $connection) or die ("Can't select database.");//delete all records from p1_select table;$_del = mysql_query("delete from p1_select;");//insert the selected recorcd into p1_select table;$_ins = mysql_query("insert into p1_select from p1 where CHR=$chk;");?>the goal are:1. clean the data which existing in the table p1_select2. insert new data into the table p1_selectbut it seems doesn't work for me. Can anyone can tell me how to perform the script?Thank you,

Link to comment
Share on other sites

Hello,I wrote a code like this:<?phpif (!isset($_POST['getid'])) ( $chk=$_POST["getid"] ) ;$chk=$_POST["getid"];$hostname='localhost';$user='root';$pass='Openit4me';$dbase='mytest';$connection = mysql_connect("$hostname" , "$user" , "$pass") or die ("Can't connect to MySQL");$db = mysql_select_db($dbase , $connection) or die ("Can't select database.");//delete all records from p1_select table;$_del = mysql_query("delete from p1_select;");//insert the selected recorcd into p1_select table;$_ins = mysql_query("insert into p1_select from p1 where CHR=$chk;");?>the goal are:1. clean the data which existing in the table p1_select2. insert new data into the table p1_selectbut it seems doesn't work for me. Can anyone can tell me how to perform the script?Thank you,
I solved the problem.Thanks,
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...