select and echo a single field from mysql db using PHP

前端 未结 4 704
一生所求
一生所求 2021-02-02 16:46

Im trying to select the title column from a particular row

$eventid = $_GET[\'id\'];
$field = $_GET[\'field\'];
$result = mysql_query(\"SELECT $field FROM `event         


        
4条回答
  •  花落未央
    2021-02-02 17:11

    Try this:

    echo mysql_result($result, 0);
    

    This is enough because you are only fetching one field of one row.

提交回复
热议问题