Please Help me..MySQL
| From: | Mohsen Pahlevanzadeh | Date: | Thu, 24 Jul 2003 03:58:22 +0000 |
| Subject: | Please Help me..MySQL | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-18611@lists.php.net to get a copy of this message | ||
Hi dears.
I have a .html file what it have a form that it refer to
my script file.
my script file is follow script:
<?php
$fn=$HTTP_POST_VARS['fname'];
$ln=$HTTP_POST_VARS['lname'];
$fa=$HTTP_POST_VARS['faname'];
$in=$HTTP_POST_VARS['idnumber'];
$bd=$HTTP_POST_VARS['birthdate'];
$bc=$HTTP_POST_VARS['birthcity'];
$ls=$HTTP_POST_VARS['learningsys'];
$sn=$HTTP_POST_VARS['studentnumber'];
$iy=$HTTP_POST_VARS['inputyear'];
print "$fn<br />$ln<br />$fa<br />$in<br />$bd<br />$bc<br
/>$ls<br />$sn
<br />$iy";
mysql_connect("localhost","","") or die("Can't connect to
server!");
$query="INSERT INTO students
VALUES(\'$fn\',\'$ln\',\'$fa\',\'$in\',
\'$bd\',\'$bc\',\'$ls\',\'$sn\',$in)";// $in a
integer variable
mysql_db_query("SMR",$query) or die("No send the query");
mysql_close();
?>
Unfortunetly,this script print my variables & print "No send the query".
But when i put a query that it obtain "Select * from student",this script don't
print "No Send the query".This means that MySQL accept my query.
Please guide me that i can put a INSERT query.
--regards
_____________________________________________________________
Thank you for choosing LinuxQuestions.
http://www.linuxquestions.org