monkeypaw201 Posted June 16, 2008 Share Posted June 16, 2008 <?php $updateSQL = sprintf("INSERT INTO vamsys_users (username, password, admin) VALUES (%s, %s, %s)", GetSQLValueString($_POST['username'], "text"), GetSQLValueString(sha1($_POST['password']), "text"), GetSQLValueString($_POST['admin'], "text")); mysql_select_db($database_vamsys, $vamsys); $Result1 = mysql_query($updateSQL, $vamsys) or die(mysql_error()); ?> error: Fatal error: Call to undefined function GetSQLValueString() in install.php on line 58 any ideas? Quote Link to comment Share on other sites More sharing options...
bluejay002 Posted June 16, 2008 Share Posted June 16, 2008 <?php $updateSQL = sprintf("INSERT INTO vamsys_users (username, password, admin) VALUES (%s, %s, %s)", GetSQLValueString($_POST['username'], "text"), GetSQLValueString(sha1($_POST['password']), "text"), GetSQLValueString($_POST['admin'], "text")); mysql_select_db($database_vamsys, $vamsys); $Result1 = mysql_query($updateSQL, $vamsys) or die(mysql_error()); ?> error: Fatal error: Call to undefined function GetSQLValueString() in install.php on line 58 any ideas? GetSQLValueString() does not exist in install.php... check install.php if it really has a function named that way. and that includes the casing. Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted June 16, 2008 Share Posted June 16, 2008 Isn't it some sort of Dreamweaver muck? You'll no doubt need to include some other file. Quote Link to comment Share on other sites More sharing options...
monkeypaw201 Posted June 16, 2008 Author Share Posted June 16, 2008 ok, well.. i removed that function and am using this now $pass=sha1($_POST['password']); $updateSQL = sprintf("INSERT INTO vamsys_users (username, password, admin) VALUES ('$_POST[username]','$pass','$_POST[admin]')"); mysql_select_db($database_vamsys, $vamsys); $Result1 = mysql_query($updateSQL, $vamsys) or die(mysql_error()); $updateSQL = sprintf("INSERT INTO `vamsys_settings` VALUES (1, 'Your New Website!', '$_POST[domain]', 'Default', 'default', 'Copyright 2008 VAMSys - All Rights Reserved', 'admin@yourdomain.com', 'home', 'VAM', '', 'No', '80', '80'"); mysql_select_db($database_vamsys, $vamsys); $Result1 = mysql_query($updateSQL, $vamsys) or die(mysql_error()); and now i'm getting this error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 Quote Link to comment Share on other sites More sharing options...
trq Posted June 16, 2008 Share Posted June 16, 2008 Its likely that your $_POST variables aren't defined or are empty. You need to check this prior to attempting to use them. Quote Link to comment Share on other sites More sharing options...
monkeypaw201 Posted June 16, 2008 Author Share Posted June 16, 2008 i have a form to submit them and i've triple check the names.. here is then rest of the relavent code: <?php if($_GET['step'] == "3"){ ?> <form name="form1" method="post" action="install.php?step=4"> <table width="100%" border="0"> <tr> <td>Username</td> <td><label> <input type="text" name="username" id="username"> </label></td> </tr> <tr> <td>Password</td> <td><label> <input type="password" name="password" id="password"> </label></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td>Domain (ie http://google.com/)</td> <td><label> <input type="text" name="domain" id="domain"> </label></td> </tr><input type="hidden" name="admin" id="admin" value="yes" /> <tr> <td> </td> <td><label> <input type="submit" name="button" id="button" value="Continue"> </label></td> </tr> </table> </form> ** Your Domain MUST have a trailing slash and any sub-directory <?php } if($_GET['step'] == "4"){ require_once("Connections/vamsys.php"); $pass=sha1($_POST['password']); $updateSQL = sprintf("INSERT INTO vamsys_users (username, password, admin) VALUES ('$_POST[username]','$pass','$_POST[admin]')"); mysql_select_db($database_vamsys, $vamsys); $Result1 = mysql_query($updateSQL, $vamsys) or die(mysql_error()); $updateSQL = sprintf("INSERT INTO `vamsys_settings` VALUES (1, 'Your New Website!', '$_POST[domain]', 'Default', 'default', 'Copyright 2008 VAMSys - All Rights Reserved', 'admin@yourdomain.com', 'home', 'VAM', '', 'No', '80', '80'"); mysql_select_db($database_vamsys, $vamsys); $Result1 = mysql_query($updateSQL, $vamsys) or die(mysql_error()); echo "Administrator Account Added and Domain configured... <br><br><a href='install.php?step=5'>Continue...</a>"; } ?> Quote Link to comment Share on other sites More sharing options...
monkeypaw201 Posted June 16, 2008 Author Share Posted June 16, 2008 bump Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted June 16, 2008 Share Posted June 16, 2008 Change both of your queries to this: $Result1 = mysql_query($updateSQL, $vamsys) or die(mysql_error().'<br />Query was:'.$updateSQL); Quote Link to comment Share on other sites More sharing options...
monkeypaw201 Posted June 16, 2008 Author Share Posted June 16, 2008 new output: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 Query was:INSERT INTO `vamsys_settings` VALUES (1, 'Your New Website!', 'http://www.vamsys.org/demo/', 'Default', 'default', 'Copyright 2008 VAMSys - All Rights Reserved', 'admin@yourdomain.com', 'home', 'VAM', '', 'No', '80', '80' Quote Link to comment Share on other sites More sharing options...
monkeypaw201 Posted June 16, 2008 Author Share Posted June 16, 2008 if it helps any i checked the database and it has been inserting correctly... just its still giving errors... is there any way to hide the errors and just continue running the script? Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted June 16, 2008 Share Posted June 16, 2008 new output: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 Query was:INSERT INTO `vamsys_settings` VALUES (1, 'Your New Website!', 'http://www.vamsys.org/demo/', 'Default', 'default', 'Copyright 2008 VAMSys - All Rights Reserved', 'admin@yourdomain.com', 'home', 'VAM', '', 'No', '80', '80' There you are then. You're missing the the closing bracket in your list of fields to insert. Try: $updateSQL = sprintf("INSERT INTO `vamsys_settings` VALUES (1, 'Your New Website!', '$_POST[domain]', 'Default', 'default', 'Copyright 2008 VAMSys - All Rights Reserved', 'admin@yourdomain.com', 'home', 'VAM', '', 'No', '80', '80')"); Quote Link to comment 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.