PFMaBiSmAd Posted January 14, 2013 Share Posted January 14, 2013 Your error messages refer to mysql_ (without the i) statements. That's not what you posted for the code in init.php. You either have more than one file named init.php and the wrong one is being included (due to the actual path where it is at) or the actual file isn't the one you have posted the code for. All your mysqli_ statements must be the same 'flavor', with the i Quote Link to comment Share on other sites More sharing options...
acarder488 Posted January 15, 2013 Author Share Posted January 15, 2013 Thanks PFMaBiSmAd, I am still getting 1 error now and I have changed it to the "i". <?php include_once('init.php'); if (isset($_POST['fname'], $_POST['lname'], $_POST['phone'], $_POST['address'], $_POST['department'], $_POST['email'], $_POST['level'])) { $fname = mysqli_real_escape_string (htmlentities ($_POST['fname'])); $lname = mysqli_real_escape_string (htmlentities ($_POST['lname'])); $address = mysqli_real_escape_string (htmlentities ($_POST['address'])); $department = mysqli_real_escape_string (htmlentities ($_POST['departmenet'])); $email = mysqli_real_escape_string (htmlentities ($_POST['email'])); $level = mysqli_real_escape_string (htmlentities ($_POST['level'])); $query ="INSERT INTO Oktoberfest2013 SET 'First_Name'='{$fname}'; 'Last_Name'='{$lname}'; 'Phone'='{$phone}'; 'Address'='{$address}'; 'Department'='{$department}'; 'Email_Address'='{$email}'; 'Level_of_Training'='{$level}'"; mysqli_query($query); } ?> <html> <head> <title>Registration form for Octoberfest With O-G EMS 2013</title> </head> <body> <form action="" method="post"> <p Registration /> <p>First Name:<input type="text" name="fname" > </p> <p>Last Name:<input type="text" name="lname" > </p> <p>Phone Number:<input type="text" name="phone" ></p> <p>Address:<input type="text" name="address" ></p> <p>Department:<input type="text" name="department" ></p> <p>Email Address:<input type="text" name="email" ></p> <p>Level of Training:<input type="text" name="level" ></p> <input type="submit" name="btn_submit" value="Register"> </form> </body> </html> form <?php include_once('config1.php'); mysqli_connect($config['DB_HOST'], $config['DB_USER'], $config['DB_PASS']); mysqli_select_db(DB_NAME); ?> init.php file <?php $config['DB_HOST'] = 'localhost'; $config['DB_USER'] = ''; $config['DB_PASS'] = ''; $config['DB_NAME'] = ''; ?> config file..... I keep getting : Warning: mysqli_select_db() expects exactly 2 parameters, 1 given in /www/zzl.org/o/t/t/ottawaglandorfems/htdocs/init.php on line 6 Thanks as always for you help!! Quote Link to comment Share on other sites More sharing options...
acarder488 Posted January 15, 2013 Author Share Posted January 15, 2013 Ok actually I am still getting : Warning: mysqli_select_db() expects exactly 2 parameters, 1 given in /www/zzl.org/o/t/t/ottawaglandorfems/htdocs/init.php on line 6 Warning: mysqli_real_escape_string() expects exactly 2 parameters, 1 given in /www/zzl.org/o/t/t/ottawaglandorfems/htdocs/reg.php on line 13 Warning: mysqli_real_escape_string() expects exactly 2 parameters, 1 given in /www/zzl.org/o/t/t/ottawaglandorfems/htdocs/reg.php on line 14 Warning: mysqli_real_escape_string() expects exactly 2 parameters, 1 given in /www/zzl.org/o/t/t/ottawaglandorfems/htdocs/reg.php on line 15 Warning: mysqli_real_escape_string() expects exactly 2 parameters, 1 given in /www/zzl.org/o/t/t/ottawaglandorfems/htdocs/reg.php on line 16 Warning: mysqli_real_escape_string() expects exactly 2 parameters, 1 given in /www/zzl.org/o/t/t/ottawaglandorfems/htdocs/reg.php on line 17 Warning: mysqli_real_escape_string() expects exactly 2 parameters, 1 given in /www/zzl.org/o/t/t/ottawaglandorfems/htdocs/reg.php on line 18 Warning: mysqli_query() expects at least 2 parameters, 1 given in /www/zzl.org/o/t/t/ottawaglandorfems/htdocs/reg.php on line 32 Quote Link to comment Share on other sites More sharing options...
Christian F. Posted January 15, 2013 Share Posted January 15, 2013 If you look at the PHP manual for those functions, you'll see exactly how to use it. Including the reason for why you're getting the above error messages. The error messages themselves tells you what's wrong, especially if you read the PHP manual. Quote Link to comment Share on other sites More sharing options...
cpd Posted January 15, 2013 Share Posted January 15, 2013 With all due respect, can you apply a bit of common sense and look at your configuration as I pointed out before. I gave you the answer once, ChristianF has pointed you in the right direction, now figure it out for yourself. Quote Link to comment Share on other sites More sharing options...
acarder488 Posted January 15, 2013 Author Share Posted January 15, 2013 yup cpd. I did and I have figured it out. I had been looking over the manual when I asked it again. I knew I was close and very close at that. Thank you again for your patience and help. Quote Link to comment Share on other sites More sharing options...
cpd Posted January 15, 2013 Share Posted January 15, 2013 Good man. Well done! 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.