Jump to content

Ugh.. error on one page, but works fine on other page.


virtuexru

Recommended Posts

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]
<?php

session_start();

// user logged in test
if (!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]

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.