Read one column from one row from a MySQL database

前端 未结 8 1924
没有蜡笔的小新
没有蜡笔的小新 2021-01-15 03:30

Is there a quick and dirty way to get the value of one column from one row? Right now I use something like this:

$result = mysql_query(\"SELECT value FROM ta         


        
相关标签:
8条回答
  • 2021-01-15 04:26

    Try this:

    $result = mysql_query("SELECT value FROM table WHERE row_id='1'");
    $row = mysql_fetch_row($result);
    return $row[0];
    
    0 讨论(0)
  • 2021-01-15 04:26

    Create a simple function to contain your lookup-code, which you can call for your database lookups in a single statement.

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