PHP mysql_num_rows die error

前端 未结 3 466
小鲜肉
小鲜肉 2021-01-28 03:14

I want to create one page, where users add their informations.. I allready have that page created, but my real problem its down code..

I have some kind of problem, with

相关标签:
3条回答
  • 2021-01-28 03:26

    Well the problem is, that your SQL Statement does not have any results.

    Please check if your database contains some rows for this idstire.

    0 讨论(0)
  • 2021-01-28 03:28

    mysql_query should have the second parameter as the connection which is in your case $db

    $resource = mysql_query("SELECT * FROM stiri2 WHERE idstire = " . $idstire,$db);
    

    if this also not works then use mysql_error to know the exact error

    $row=mysql_num_rows($resource);
    if($row)
    {
    
    }
    else
    {
        mysql_error();
    }
    

    this will show you if there is problwm in mysql_num_rows

    0 讨论(0)
  • 2021-01-28 03:41

    If $_GET['idstire'] is not set, you are setting $idstire to 0. Is there any entry in the table for idstire=0?

    You can print your php query with $idstire replaced with its value. Take that query and execute in phpmyadmin to see the error. Also verify that row exists for the value of $idstire being used in the query.

    0 讨论(0)
提交回复
热议问题