mysql - I have a php error. But I don't understand why -


i have problem in code. i'm trying make private chat. using php , mysql. have error: "fatal error: uncaught exception 'mysqli_sql_exception' message 'table 'b7_19757973_4hfbroup.asdfannedegraaff' doesn't exist" , know means table not exist. use code if table exist:

$query = mysqli_query($con, "select * `".$_session['senderreceiver']."`"); if(!$query)    echo "the s not exists"; $query2 = mysqli_query($con, "select * `".$_session['receiversender']."`"); if(!$query2)    echo "the f not exists"; 

but still error, how can fix this?

btw session made this:

$sender = $_session['username'];  $receiver = $_post["name"]; $senderreceiver = $sender . $receiver; $receiversender = $receiver . $sender;  $_session['senderreceiver'] = $senderreceiver; $_session['receiversender'] = $receiversender; 

i'm sorry bad english , bad explanation. hope can me..

if table not exist, mysqli throw error.

try instead show tables 'tablename';

but 1 further concern: not save database table names inside session. it's bad practice , in 99% of cases not needed


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -