simple insert command gone bad (please help!)
Posted 26 February 2006 - 02:50 AM
This script inserts the users ip address and the fact they voted for movie 1 by changing the column 1 (signifying movie one) to the number 1 (default = 0 = not voted)...I really want to make the column 1 a variable and really don't want to change using an int as as my column.
$sqlr = "INSERT INTO voters (ip,1) VALUES ('$ip',1)";
mysql_query($sqlr) or die(mysql_error());
all values confirmed....db structure checked.
Please help!! Thank you so much - Justin
Posted 26 February 2006 - 03:03 AM
Posted 26 February 2006 - 06:33 AM
Also your database structure sounds ill-thought out. You have a table for every movie? So every time you add a movie, you add a table to the database? That's not good design.
Why not 3 tables:
movies (id, title, description)
users (id, ipaddress)
votes (userid, movieid)
Posted 27 February 2006 - 09:31 PM
Thanks a heap - Jutboy
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users