troubleshooting Question

php to mysql error godaddy hosting

Avatar of bcmeyer1983
bcmeyer1983 asked on
PHPMySQL Server
11 Comments2 Solutions1803 ViewsLast Modified:
GoDaddy Hosting &  GoDaddy MySql.

PHP Code:

<?php
$hostname='hostnamehere';
$username='usernamehere';
$password='passwordhere';

mysql_connect($hostname,$username,$password);

if (mysqli_connect_errno()) {
      printf("Connect failed: %s\n", mysqli_connect_error());
      exit();
} else

$inName = ($_POST['name']);
$inCompany = ($_POST['company']);
$inCity = ($_POST['city']);
$inEmail = ($_POST['email']);
$inZipcode = ($_POST['zipcode']);
$inPhone = ($_POST['phone']);
$inFax = ($_POST['fax']);
$inTrade1 = ($_POST['trade1']);
$inTrade2 = ($_POST['trade2']);
$inTrade3 = ($_POST['trade3']);
$inTrade4 = ($_POST['trade4']);
$inTrade5 = ($_POST['trade5']);
$inTrade6 = ($_POST['trade6']);

$sql = "INSERT INTO tabelnamehere (name,company,city,email,zipcode,phone,fax,trade1,trade2,trade3,trade4,trade5,trade6) VALUES
  ('$inName','$inCompany','$inCity','$inEmail','$inZipcode','$inPhone','$inFax','$inTrade1','$inTrade2','$inTrade3','$inTrade4','$inTrade5','$inTrade6')";

$res = mysqli_query($mysqli, $sql);

if ($res === TRUE) {
            echo "record has been inserted";
      } else {
            printf("could not insert record: %s\n", mysqli_error($mysqli));
      }
      
            mysqli_close($mysqli);
      

?>

Error when html prcocesses script:

Fatal error: Call to undefined function: mysqli_connect_errno() in /home/content/h/a/l/somestuffiwanttohide/html/test/register.php on line 8
ASKER CERTIFIED SOLUTION
Angelp1ay

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 11 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 11 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros