Jump to content

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"; 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.