Jump to content

How do I test and view the results after executing a SQL command?


genzedu777

Recommended Posts

Hi,

 

I am not too sure if I have used the right command, I am using print_r($sql), to view my executed results, but apparently I received mysqli_result Object ( ) , any advice? Thanks

 

$dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME) or die(mysqli_error($dbc));
    
    //Run query
    $tutor_id = mysqli_real_escape_string($dbc, $_GET['tutor_id']);

$query = "SELECT tpd.district_id, tpd.district_name, tpz.zone_id, tpz.zone_name     
			 FROM tutor_preferred_district AS tpd
			 INNER JOIN tutor_preferred_dlocation AS tpdl USING (district_id)
			 INNER JOIN tutor_preferred_zlocation AS tpzl USING (tutor_id)
			 INNER JOIN tutor_preferred_zone AS tpz USING (zone_id)
                 WHERE tpdl.tutor_id = '{$tutor_id}'";


$sql = mysqli_query($dbc, $query) 
or die(mysqli_error($dbc));
print_r($sql);

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.