Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

yet another php prob


mrdj204's Avatar
Member
0 0

why is it i get this error


Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/djthegod/public_html/money/index.php on line 13```

with this code?
```markup
<?php

include "config.php";

$lol = mysql_query('SELECT,Item FROM money ORDER BY Item DESC');
$lol2 = mysql_query('SELECT,Value FROM money ORDER BY Item DESC');
$lol3 = mysql_query('SELECT,Total FROM money ORDER BY Item DESC');

mysql_fetch_array($lol);

echo "<center><table border=1><tr><td><center>Item</center></td><td><center>Price</center></td><td><center>Funds</center></td></tr>";

While ($row = mysql_fetch_array($lol))
{

  echo "<tr><td><center><a href=edit.php?=" . $row['Item'] . ">" . $row['Item'] . "</center></td>";
  
  mysql_fetch_array($lol2);
  
  echo "<td><center>$" . $row['Value'] . "</center></td>";
  
  mysql_fetch_array($lol3);
  
  echo "<td><center>$" . $row['Total'] . "</center></td></tr>";
  
}
  
?>```

any help would be appreciated, as usual

mrdj204's Avatar
Member
0 0

nah, that didnt work, but thx


mrdj204's Avatar
Member
0 0

nope:@:@:@:@:@:@:@


ghost's Avatar
0 0

You need to remove the , after select


ghost's Avatar
0 0

Have you connected to the database?

Selected the db?


ghost's Avatar
0 0

heres your problem:

mysql_fetch_array($lol);

echo "<center><table border=1><tr><td><center>Item</center></td><td><center>Price</center></td><td><center>Funds</center></td></tr>";

While ($row = mysql_fetch_array($lol))
{```
as soon as you get a result form a mysql query it becomes invalid. as in you cant use the same result twice.