Mysql SELECT and INSERT Error

Posted by nepaliking on Stack Overflow See other posts from Stack Overflow or by nepaliking
Published on 2010-06-07T10:52:26Z Indexed on 2010/06/07 11:02 UTC
Read the original article Hit count: 111

Filed under:
|

I am using sort field in order to sort records. My code is this

    $query = "SELECT max(sort) FROM $this->table LIMIT 1;";
    $result = mysql_query($query);
    $row = mysql_fetch_row($result);
    $sort = $row[0]+1;
    $query = "INSERT INTO "$this->table." VALUES ( '', '$ini', '$time', '$ip', '0', '$type', '$sort', '$title', '$image', '0' );";
            $result = mysql_query($query) or die(mysql_error());

What is the error here?

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql