Quote:
Originally Posted by lovinlazio9
sorry about that, I figured it out last night...REALLY LATE NIGHT!...unfortunately the script isn't putting anything into the MySql database though....it just keeps putting blank entries in the table...any thoughts?
my code to connect to the database is as follows:
****************************************PHP******* *************************************
<?
$DBhost = "localhost";
$DBuser = "grademyc_me";
$DBpass = "********";
$DBName = "grademyc_users";
$table = "details";
mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable to connect to database");
@mysql_select_db("$DBName") or die("Unable to select database $DBName");
$sqlquery = "INSERT INTO $table VALUES('$Name')";
$results = mysql_query($sqlquery);
mysql_close();
?>
************************************************** ***********************************
every time i try to update the database through my form is just creates a blank entry which is really annoying...i can obviously update the database via phpMyadmin, but that doesn't help me.....Thanks!
Danny
Hi ..
Try using the Insert statement with the table column name like ..
[PHP]$sqlquery = "INSERT INTO $table ('column_name_1','column_name_2', ..etc)VALUES('$value_1, $value_2', ..etc)";[/PHP]
Hope this will work ...good luck !