Hello! 🙂
I am new to mySQL database, I guess I make some kind of a newbie error. There is no data added to the database, and it is no error msg given.
The database name is: user_tonydb and the table name is : reviews. I have granted access for the user to the database.
I really would be happy for any kind of help.
$Link = mysql_connect("localhost", "user_user", "password");
mysql_select_db("reviews", $Link);
$datum = date("Y-j-n");
echo "$datum <BR>\n";
echo "$typ <BR>\n";
echo "$artist <BR>\n";
echo "$title <BR>\n";
echo "$rating <BR>\n";
echo "$coverlink <BR>\n";
echo "$author <BR>\n";
echo "$authoremail <BR>\n";
echo "$reviewtext <BR>\n";
echo "$link1 <BR>\n";
echo "$link2 <BR>\n";
$Query = "insert into reviews( `datum, `typ` , `artist` , `title` , `rating` , `coverlink` , `author` , `authoremail` , `reviewtext` , `link1` , `link2` , `approved` , `clicks` )
values ( '$datum', '$typ', '$artist', '$title', '$rating', '$coverlink', '$author', '$authoremail', '$reviewtext', '$link1', '$link2', '0','0')";
mysql_db_query ( "user_tonydb", $Query, $Link);
And get this output:
2003-4-16
Show Review
Madonna
Like a virgin
Decent
none
Scott
[email]Scoot@usa.com[/email]
Great album, bla bla bla
none
none
So I know there is data in all variables.
The design of the mySQL database looks like this:
Field Type Attributes Null Default Extra Action
id int(10) No auto_increment
datum varchar(100) Yes NULL
typ varchar(100) Yes NULL
artist varchar(100) Yes NULL
title varchar(100) Yes NULL
rating varchar(100) Yes NULL
coverlink varchar(100) Yes NULL
author varchar(100) Yes NULL
authoremail varchar(100) Yes NULL
reviewtext varchar(100) Yes NULL
link1 varchar(100) Yes NULL
link2 varchar(100) Yes NULL
approved tinyint(100) Yes 0
clicks varchar(100) Yes 0
I am clueless now. 😕