I'm actually coding the schedule of some conferences and I'm a little bit derping with the php code.
The code is the following:
<?php
mysql_connect("localhost","root","root");
mysql_select_db("pbeusr3");
$sql="SELECT id_s, sessionname FROM sessions";
$result=mysql_query($sql);
$i=0;
if($result!=NULL)
{
if(mysql_num_rows($result)>0)
{
while($row=mysql_fetch_array($result))
{
//here you can work with the results...
echo "Session ".$row['id_s'].":" .$row['sessionname'];
echo "<br>";
$a = $row['id_s'];
$sql2="SELECT id_p FROM presentations WHERE id_s='$a'";
$result2 = mysql_query($sql2);
$sql3="SELECT title, author1 FROM papers WHERE id_p='$result2'";
$result3 = mysql_query($sql3);
while($row2= mysql_fetch_array($result3))
{
echo "Title ".$row2['title']. " Author: " .$row2['author1'];
echo "<br>";
}
}
}
else
{
}
mysql_free_result($result);
}
mysql_close();
?>
The output of this code is intended to be something like Session: Name of the session. Title of the paper and author of that session.
Instead I only see the Session and Name of the session (first fetch) but then I can't see the paper part (second fetch).
Any help?
Thank you