PDA

View Full Version : php/mysql insert...


Laguana
01-12-2005, 08:50 AM
EDIT: Fixed it. Don't you hate stupid typos and the like? I shall return to the cave from whence i came now.

Hey,

I'm entirely new to the php/mysql thing... but i'm trying to set up a php thing so flash can tell it a bunch of strings and numbers, and php goes and stores it in a mysql database.

So far i've worked out how to retrieve the posted variables (through $_POST[variable name]) and i've found out how to connect to a database, and that works. I've also created a database with the columns which i want.

The problem arises when i try to insert the data into the database. I can put it in via phpmyadmin, and i've looked at the php code that can generate for you and as far as i could see i've got the same thing (without a few ` which i found out were extraneous.)

I've got the lines


$query = "INSERT INTO Curves(unique_id,date,points,colours,ratios,matrix ,alphas,comment)";
$query .= "VALUES('$Timestamp', '$Date', '$Points', '$Colours', '$Ratios', '$Matrix', '$Alphas', '$Comment')";
$result = mysql_query($query);


where my table is called Curves, and i'm connected to the database. However, there is never a $result, and phpmyadmin can't see any rows added.

I know this is quite a noobish question, but can anyone help me work this out? I can't see anything wrong with what i've done, and it doesn't even give an error that i can see.

thanks.