danx30 Posted November 20, 2009 Share Posted November 20, 2009 mysql_query("INSERT INTO '.$name.' (amount) VALUES ('$amount')"); Can't seem to figure out what I'm doing wrong with that line. It doesn't insert anything into the database. Any help would be appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/182343-insert-into-problem/ Share on other sites More sharing options...
papaface Posted November 20, 2009 Share Posted November 20, 2009 mysql_query("INSERT INTO ".$name." (amount) VALUES ('".$amount."')"); Quote Link to comment https://forums.phpfreaks.com/topic/182343-insert-into-problem/#findComment-962242 Share on other sites More sharing options...
danx30 Posted November 20, 2009 Author Share Posted November 20, 2009 Hmm, still not working. Quote Link to comment https://forums.phpfreaks.com/topic/182343-insert-into-problem/#findComment-962243 Share on other sites More sharing options...
ThunderLee Posted November 20, 2009 Share Posted November 20, 2009 What is the value of $name? Quote Link to comment https://forums.phpfreaks.com/topic/182343-insert-into-problem/#findComment-962244 Share on other sites More sharing options...
danx30 Posted November 20, 2009 Author Share Posted November 20, 2009 The name of the user pulled from the URL, and a table created using that name. Quote Link to comment https://forums.phpfreaks.com/topic/182343-insert-into-problem/#findComment-962246 Share on other sites More sharing options...
PFMaBiSmAd Posted November 20, 2009 Share Posted November 20, 2009 Making a separate table for each user is bad and will cause you grief at every step. echo mysql_error(); after that line of code to find out why the query is failing. Quote Link to comment https://forums.phpfreaks.com/topic/182343-insert-into-problem/#findComment-962247 Share on other sites More sharing options...
danx30 Posted November 20, 2009 Author Share Posted November 20, 2009 No errors showing up. It's just not adding the info to the database. Quote Link to comment https://forums.phpfreaks.com/topic/182343-insert-into-problem/#findComment-962248 Share on other sites More sharing options...
ThunderLee Posted November 20, 2009 Share Posted November 20, 2009 Why don't you have a table for all users? I don't get each user having their own table as it doesn't make sence..? Is there any reason you want each user having their own table? Quote Link to comment https://forums.phpfreaks.com/topic/182343-insert-into-problem/#findComment-962250 Share on other sites More sharing options...
PFMaBiSmAd Posted November 20, 2009 Share Posted November 20, 2009 No errors showing up. It's just not adding the info to the database. Then either your code is not being executed at all or the mysql extension is not enabled on your server. What is your complete code, including the form that is submitting the data and have any mysql_ instructions executed correctly on your server? Quote Link to comment https://forums.phpfreaks.com/topic/182343-insert-into-problem/#findComment-962251 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.