virtuexru Posted November 13, 2006 Share Posted November 13, 2006 Ok. So when a user is NOT logged in, I redirect him to another page and the page has this code:[code] <? include 'config.php'; include 'opendb.php'; $result = mysql_query("SELECT * FROM joborder WHERE number=$id"); $row = mysql_fetch_array($result); echo "<h2>".$row["title"]; echo "</h2>"; echo "<p/><b>Category:</b> ".$row["category"]; echo "<br><b>Description:</b> ".$row["description"]; echo "<br><b>Salary:</b> ".$row["salary"]; echo "<br><b>Position:</b> ".$row["position"]; echo "<br><b>Location:</b> ".$row["location"]; echo "<p><b>Details:</b><p> ".$row["details"]; echo "</p></p>"; ?>[/code]yet I'm getting this error:[color=red]Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/***/***/***/viewlog.php on line 40[/color]However on the first page when it works, I don't get an error. The only difference with the first page and this page is that the first page includes this at the top:[quote]<?phpsession_start();// user logged in testif (!isset($_SESSION['image_is_logged_in']) || $_SESSION['image_is_logged_in'] !== true) { // not logged in, move to login page header('Location: viewlog.php'); exit;}?>[/quote] Link to comment https://forums.phpfreaks.com/topic/27125-ugh-error-on-one-page-but-works-fine-on-other-page/ Share on other sites More sharing options...
Orio Posted November 13, 2006 Share Posted November 13, 2006 Where did you set $id ?Orio. Link to comment https://forums.phpfreaks.com/topic/27125-ugh-error-on-one-page-but-works-fine-on-other-page/#findComment-123975 Share on other sites More sharing options...
virtuexru Posted November 13, 2006 Author Share Posted November 13, 2006 the page itself..http://www.***.com/view.php?=$idoh damn.. haha answered my own question.. it should be linked to viewlog.php instead of the original page..thanks orio haha Link to comment https://forums.phpfreaks.com/topic/27125-ugh-error-on-one-page-but-works-fine-on-other-page/#findComment-123983 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.