mysqli - PHP -> mySQL Connection Errors -
i'm having connection errors trying connect php mysql. i'm using video instructable, because i've been having several of these connections before, outdated , i'm trying use mysqli instead of mysql commands, i'm winding nothing posting on pages, think because of this. can tell me if correct translation of it?
function user_exists($username) { $username = sanitize($username); $query = mysqli_query("select count('user_id') 'users' 'username' = '$username'");
sanitize defined on page (and included) as:
<?php function sanitize ($data) { return mysqli_real_escape_string($data); } ?>
please help!
first need connect mysql..is function have ? incomplete..on screen..
example..
$link = mysqli_connect("localhost","root","","database") or die("error " . mysqli_error($link)); $query = "select `release_year` film limit 5" or die("error in consult.." . mysqli_error($link)); //execute query. $result = $link->query($query);
Comments
Post a Comment