that code isn't working. anyone know why?PHP Code:$sql = "INSERT INTO $dbname.$tblname (name,password,email,user_id) VALUES($username,$pass,$email,NULL)";
that code isn't working. anyone know why?PHP Code:$sql = "INSERT INTO $dbname.$tblname (name,password,email,user_id) VALUES($username,$pass,$email,NULL)";
Last edited by matzomeal; 05-26-2009 at 06:43 PM.
unless you're calling
mysql_query($sql);
you need:
PHP Code:$sql = mysql_query("INSERT INTO $dbname.$tblname (name,password,email,user_id) VALUES($username,$pass,$email,NULL)");
█ Neil Hanlon | x10Hosting Support Representative
█ Neil[at]x10hosting.com
█ I'm always happy to help. Just ask a question in Free Hosting
█ Terms of Service IRC
Another one: can field user_id be NULL? What's the definition for the user_id column?
I've got a question, are table names case sensetive? What I mean is: is ichwar going to be different from ICHWAR or IcHwAr?
off course php is case sensitive
gjr.gr - coming soon: secrets of OCD coding from a self taught tinkerer
matzomeal, what do you mean by not working?
If you mean not executing, then try as leafypiggy said.
If you mean that you get a php error stating that a variable is not defined, then define all you variables, as lemon-tree said.
If you are getting a false result from mysql_query, then do a var_dump on the sql variable, and copy the value in PhpMyAdmin. This will point out any error in your query.
█ Xavier L | Community Public Relations Manager (Free Hosting Support)
█ Yes, my position is too cool to even exist!
█ How am I helping? Rate this post by clicking theicon below! (this is even better than "liking" a post)
█ Terms of Service | Acceptable Use Policy | x10Hosting Wiki