I'm trying to create a variable named $period1 by using the value of $info[per1] to fetchRow from the classes table in a MySQL database. I'm using the following code to make the MySQL call. I am connected properly, I'm able to
My code...
$info = $db->fetchRow("select * from `profiles` where `username` =?", array($logged_in));
$period1 = $db->fetchRow("select * from `classes` where `name` =?", array($info[per1]));
The following prints Web Design and is what I use to search the classes table.
<?php echo $info[per1]?>
classes table
id name teacher cost
1 Web Design Benrud 999
The results of the echos
<?php echo $period1?>
returns: Array
<?php echo $period1[1]?>
returns: a blank
Any suggestions?
Thanks for your help!