I have this code that someone gave me that is supposed to take the thing you enter and add it to a mySQL DB.
$link = mysql_connect ($host, $user, $password);
$query = "INSERT into $tablename VALUES ('0', '$key')";
print ("Error<BR>\n");
if (mysql_db_query ($dbname, $query, $link)) {
print ("404 page not found, please hit the back button on your browser or type a new url<BR>\n");
} else {
print ("E R R O R 404 PAGE NOT FOUND <BR>\n");
}
mysql_close ($link);
Question
sp0rk
I have this code that someone gave me that is supposed to take the thing you enter and add it to a mySQL DB.
$link = mysql_connect ($host, $user, $password); $query = "INSERT into $tablename VALUES ('0', '$key')"; print ("Error<BR>\n"); if (mysql_db_query ($dbname, $query, $link)) { print ("404 page not found, please hit the back button on your browser or type a new url<BR>\n"); } else { print ("E R R O R 404 PAGE NOT FOUND <BR>\n"); } mysql_close ($link);When I do:
http://sp0rk-tech.net/thescript.php?key=dsosdfdsfsnds
It just inserts a blank thing in the table. It inserts a new one each time I do it, but it's like its not recognizing the data. Can anyone help?
Link to comment
Share on other sites
7 answers to this question
Recommended Posts