Jump to content
php.lv forumi

mysqli_error neatgriež kļūdu


Wuu

Recommended Posts

$result = mysqli_query($link,'insert into;');
$output[] = array("error"=>"0ssss","errors"=>mysqli_error($result)); 

vienkarsi tu jau taisiji cheku uz datubazi nevis uz kveriju tapec jau ari neko nerada ^^

Edited by Faks
Link to comment
Share on other sites

if (!mysqli_query($link, "SET a=1")) {
    printf("Errormessage: %s\n", mysqli_error($link));
}

Čo? http://php.net/manual/en/mysqli.error.php

 

okey sorry mana laza bet nu palasiju druku Manual un tiku skaidriba sajaucu mysql ar mysqli.

 

debug uz koda

0ra5bdwrvjt3fwcrd2y_thumb.jpg

reku kods skraida te teu bus gatavs kods ar ko vari niekoties talak ceru ka noderes....

ini_set('display_errors', 'On');
error_reporting(E_ALL);
ini_set('display_errors', '1');
$mysql_connect = mysqli_connect('127.0.0.1','lietotajs','kods','table',3306);
if (mysqli_connect_errno($mysql_connect)) {
    printf("Connect failed: %s\n", mysqli_connect_error());
    exit();
}

$result = mysqli_query($mysql_connect,"select * from newsx");
#$test = mysqli_fetch_assoc($result); testeju lai redzet vai iet...

#echo $test['title'];
$output[] = array("errors" => mysqli_error_list($mysql_connect));

echo '<pre>';
print_r($output);
echo '</pre>';
Edited by Faks
Link to comment
Share on other sites

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.   Paste as plain text instead

  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.

Loading...
×
×
  • Create New...