Jump to content

[SOLVED] SQL and Php query not working? ne 1 please


ali_2kool2002

Recommended Posts

:( :(

 

hi im creating a query to enter data into the table but my table has two fields one is auto increment called id and the other called name

 

the query in sql works as below

INSERT INTO test(`name`) VALUES ('smith');

 

But the same query in php doesnt work,,says couldnt execute query

$insert_query = "INSERT INTO test(`name`) VALUES ('smith')";
$result = mysql_query($insert_query) or die ("couldnt execute query");

 

ne 1 know why?

 

sorry the original line

 

"INSERT INTO test(`name`) VALUES ('ggg')"

 

was rite i just didnt connect to a databse,, would have helped if had an error sayin something about connecting but ye simple mistake of mine,,, thanks for ur help ppl.!!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.