Jump to content

[SOLVED] Warning: mysql_fetch_array(): supplied argument is not a valid MySQL...


chris_2001

Recommended Posts

I can't seem to get this to work. I have triple checked spelling yet it keeps giving the error. Anyone see anything wrong with my coding? Thanks.

 

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\empty.php on line 23

 

 

<?php

session_start();
if(!session_is_registered(myusername)){
header("location:index.php");
}

include 'mysql_connect.php';
$Username = $_SESSION["myusername"];
$query = "SELECT num, admin FROM accounts WHERE accname = '$Username'";
$result = mysql_query($query);
$row = mysql_fetch_array($result, MYSQL_ASSOC);
$usernum = $row['num'];
$admin = $row['admin'];

if ($admin == "1"){


$sql="SELECT status, number FROM tasks WHERE accountid = '$usernum' ";
$result=mysql_query($sql);


while ($myrow = mysql_fetch_array($result)){
$editnum = $myrow['number'];
$status = $myrow['status'];

if ($status == "1"){

$query = "UPDATE tasks SET status = '2' WHERE number = '$editnum'";
$result = mysql_query($query);
}



}}
?>

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.