Jump to content

can't display queries anymore


twixter

Recommended Posts

Hi, PHP noob here.

 

Got this  site which was working before. when it was migrated to a different server, all the scripts never worked anymore. add, delete, edit, etc. so i got back to zero.

 

after days of working on different scripts, got the others working out already.

 

however, for this code, it doesn't. it's supposed to display the information in view.php but it just gives me a blank page. stumped here.

 

help please and thanks in advance.

 

  
<?php 
include ('connect.php');
include ('lb.php');
mysql_select_db("dbname"); 

$query = "SELECT * FROM maintable WHERE title='statement' AND issue='television'  ORDER BY date DESC"; 

$result = mysql_db_query("dbname", $query); 
if ($result) {



echo "<center><font face=arial><b> Statements: Television</b><br><TABLE BORDER=0 cellpadding=5>"; 
echo"<TR><TD>  </B><TD>   <TD> </TR>"; 
while ($r = mysql_fetch_array($result)) {
$id = $r["id"];
$issue = $r["issue"];
$date = $r["date"];
$time = $r["time"];
$title = $r["title"];


echo "<TR><TD> $date </td><TD> <a href=\"view.php?id=$id&issue=$issue&date=$date&time=$time&title=$title\">$title</a> </td></tr>"; 
}

echo "</table></font></center>";

} else {

echo "No data.";

}

?> 

 

and this is the view.php file:

 


<html> 

  <?php include ('connect.php');?>
<?php include ('lb.php');?>


<br>
<center><table width=80% border=0 id=tablecontent cellpadding=5>
<tr>
   <td valign=top width=150 cellpadding=5><center><b><?php echo "$issue";?></b></center></td>

</tr> 



<tr><td><p align="right"><i><?php echo "$date";?></i></p></td></tr>


   
<tr><td  valign=top> <?php echo "$time";?> / <?php echo "$title";?><br><br>
  
  </td> </td></tr> </table></center></font> 




<br />
<font face=arial><center><a href="#top">Back to top</a></center></font>


</html>

Link to comment
Share on other sites

year sorry i see what you are doing now

you need to change

<?php echo "$date";?>

to

<?=$_GET["date"]?>

and repeat for the rest

 

i think i no what happed when you switched servers

you had

register_globals on

with your old server and when you switched it was turned off this stuffed all your scripts

you could try turning it on and see what happens

 

Scott.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • 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.