14.01.2012, 23:26
Hey,
I cant think of a way to display results from MySQL when querying something like this:
Not really sure how to explain this, but in PHP it would be something like this:
I'm currently using MySQL Plugin R6-2
Sorry if i didn't explain this clearly,
Thanks.
I cant think of a way to display results from MySQL when querying something like this:
pawn Код:
mysql_query("SELECT * FROM people WHERE age = '15'");
mysql_store_result();
/*
Would i format it? or...
format(query, sizeof(query), "ID: %d | Name: %s | Age: %d | Gender: %s", id, name, age, gender);
I want to display the results like this:
-------------------------------------------¬
|ID: 1 | Name: Bob | Age: 15 | Gender: Male |
|ID: 2 | Name: Jay | Age: 15 | Gender: Male |
|ID: 3 | Name: Jim | Age: 15 | Gender: Male |
|ID: 4 | Name: Dan | Age: 15 | Gender: Male |
|ID: 5 | Name: Guy | Age: 15 | Gender: Male |
-------------------------------------------
*/
mysql_free_result();
PHP код:
$sql="SELECT * FROM people";
$result=mysql_query($sql);
while($rows=mysql_fetch_array($result)){
$age = $rows['age'];
echo $age;
}
mysql_close();
Sorry if i didn't explain this clearly,
Thanks.