Jump to content

I am getting this message and not sure how to fix it.


acarder488

Recommended Posts

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

Link to comment
Share on other sites

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!! :happy-04:

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.