Lodius2000 Posted January 20, 2009 Share Posted January 20, 2009 im getting a parse error on line 148, which is the line that defines $sql I use pearDB thus the placeholders (they auto escape data) on that line, but either way, I cant find the error <?php function process_form() { global $db; $password = $_POST['password']; $username = $_POST['username']; $realname = $_POST['realname']; $email = $_POST['email']; //add user to database $sql = ('INSERT INTO users (username, password, email, real_name) VALUES (?,?,?,?)', array($username, $password, $email, $realname)); $q = $db->query($sql); $_SESSION['message'] = "$username has been registered as a user\n"; print '<a href="index.php">Login here</a>'; } ?> thanks Link to comment https://forums.phpfreaks.com/topic/141561-solved-wheres-the-error/ Share on other sites More sharing options...
Lodius2000 Posted January 20, 2009 Author Share Posted January 20, 2009 aperantly pear doesnt allow the $q= $db->query($sql) structure I replaced with $db->query("INSERT INTO users (username, password, email, real_name) VALUES (?,?,?,?)", array($username, $password, $email, $real_name)); and all is well SOLVED Link to comment https://forums.phpfreaks.com/topic/141561-solved-wheres-the-error/#findComment-740976 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.