Jump to content

Anoying SQL syntax error


paulman888888

Recommended Posts

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 'id DESC LIMIT 0,10' at line 3

There is no mysql code on line 3.

full code is error http://rockworld.atzend.com/songs/test.phps

 

Why does is say theres an error on line 3 when theres no Mysql script there?

 

I thankyou so much for the help

Paul

Link to comment
https://forums.phpfreaks.com/topic/130152-anoying-sql-syntax-error/
Share on other sites

Also, further down, shouldn't:

 

function edit_file(){

if(isset($_POST['edit_id'])):
$edit_id = $_POST['edit_id'];
$maker = $_POST['maker'];
$song_name = $_POST['song_name'];

$dataquery="UPDATE rock_songs
SETsong_name = '$song_name', maker = '$maker'
WHEREid = '$edit_id'

 

be:

 

$dataquery="UPDATE rock_songs
SET song_name = '$song_name', maker = '$maker'
WHERE id = '$edit_id'

 

And near the end:

 

function delete_file(){

if($_GET['op'] == "confirm"):
$delete_id = $_GET['id'];
$filedel = $_GET['filename'];
$dataquery="DELETEFROM rock_songs WHERE id = '$delete_id'";

 

be:

 

$dataquery="DELETE FROM rock_songs WHERE id = '$delete_id'";

And in answer to this question

Why does is say theres an error on line 3 when theres no Mysql script there?

 

the 3 refers to the line in the query statement itself

 

$query = "SELECT *
FROM rock_songs
ORDERby id DESC                          <--------- line 3
LIMIT $start,$limit"; 

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.