Jump to content

[SOLVED] error in this


chocopi

Recommended Posts

When i try to use this code:

 

<?php	
$query = @mysql_query("SELECT id,name,desc,hp,item FROM enemies WHERE id>0 ORDER BY rand() LIMIT 1");
$row = @mysql_fetch_assoc($query) or die(mysql_error());
$enemy_id = $row['id'];
$enemy_name = $row['name'];
$enemy_desc = $row['desc'];
$enemy_hp = $row['hp'];
$enemy_item = $row['item'];
?>

 

I get this error:

 

You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc,hp,item FROM enemies WHERE id>0 ORDER BY rand() LIMIT 1' a 

Link to comment
https://forums.phpfreaks.com/topic/53066-solved-error-in-this/
Share on other sites

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.