Jump to content

mysql_real_escape_string error


heldenbrau

Recommended Posts

I keep getting the following error:

 

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established

 

With this code:

 

<?php


$level = $_POST[level];
$first = $_POST[first];
$second = $_POST[second];
$third = $_POST[third];
$fourth = $_POST[fourth];

$mysqli = new mysqli("*****", "*****", "******", "********");
    if ($mysqli === false) {
      die("ERROR: Could not connect to database. " . mysqli_connect_error());
    }

$vidlink=mysql_real_escape_string($_POST[vidlink]);
$title=mysql_real_escape_string($_POST[title]);
$des=mysql_real_escape_string($_POST[des]);
$website=mysql_real_escape_string($_POST[website]);

$cat= mysql_real_escape_string($first . $second . $third . $fourth);

 

why won't it work?

Link to comment
https://forums.phpfreaks.com/topic/219113-mysql_real_escape_string-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.