-1

我有一个这样的 mySQL 表:

id | name | value
------------------
1  | logo      | blahblahblah.png
2  | namestore | blah store
3  | ip        | 0.0.0.0

我的问题是如何使用 mysql 获取该表,然后创建一个 php 调用,例如:

$store->logo (i will get blahblahblah.png)
$store->namestore ( i will get blah store)

谁能帮我?我只是对如何做到这一点感到困惑

4

1 回答 1

0
You can use that



 $sql = "select * from your_table_name;";

    if (!mysql_query($sql, $conn)) {
        die('Error: ' . mysql_error());
             echo 'error !';
    }

    $result = mysql_query($sql);

    while ($arr = mysql_fetch_assoc($result)) {
       //your fetch results are stored in $arr array. you can get values with $arr['column_name']
    }
于 2012-12-12T06:49:23.823 回答