Posted by deja on 10/10/07 17:07
Hi all,
For a couple of nights I have been trying to figure something out..
I am trying insert a couple of fields into a database. My url looks
something like this;
www.site.com/addlog.php?var1=blah&var2=blah
The addlog.php script looks like this;
<?php
$dbhost = 'xx';
$dbuser = 'xx';
$dbpass = 'xx';
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or
die ('Error connecting to mysql');
$dbname = 'xx';
mysql_select_db($dbname);
$query = "INSERT INTO log values('$var1','$var2');";
print_r($_GET);
mysql_query($query) or die('Error, insert query failed');
mysql_close($conn);
?>
The var1 variable gets passed on just fine (I even see it echoed back
with the print command).. but var2 seems to dissapear.. It never gets
passed to anywhere..
What am I missing here? When I make the url www.site.com/addlog.php?var2=blah&var1=blah
I just see var2.. so it seems to only accept the 1st variable..?
Alex
[Back to original message]
|