Új hozzászólás Aktív témák
-
Sk8erPeter
nagyúr
Ha ilyen van, miért nem kapod elő a php.net leírását?
"For SELECT, SHOW, DESCRIBE, EXPLAIN and other statements returning resultset, mysql_query() returns a resource on success, or FALSE on error."
Az adatbázis-kapcsolati erőforrás-azonosítót adja vissza."The returned result resource should be passed to mysql_fetch_array(), and other functions for dealing with result tables, to access the returned data."
Ott a példa is:
// Perform Query
$result = mysql_query($query);
// Check result
// This shows the actual query sent to MySQL, and the error. Useful for debugging.
if (!$result) {
$message = 'Invalid query: ' . mysql_error() . "\n";
$message .= 'Whole query: ' . $query;
die($message);
}
// Use result
// Attempting to print $result won't allow access to information in the resource
// One of the mysql result functions must be used
// See also mysql_result(), mysql_fetch_array(), mysql_fetch_row(), etc.
while ($row = mysql_fetch_assoc($result)) {
echo $row['firstname'];
echo $row['lastname'];
echo $row['address'];
echo $row['age'];
}=====
Nálad most csak egy sor lesz, ezért nem kell ciklus:
...
if(!empty($rows)){
$row = mysql_fetch_assoc($res);
echo 'The country code is the following: '.$row['country_code'];
}==============================================
(#9329) whited :nincs mit!
Amúgy csak szimpla i-vel Brian.
Új hozzászólás Aktív témák
- Dell és HP szerver HDD caddy keretek, adapterek. Több száz darab készleten, szállítás akár másnapra
- BESZÁMÍTÁS! Gigabyte Z790 i7 14700KF 32GB DDR5 1TB SSD RTX 4070S 12GB Be Quiet! Pure Base 501 750W
- Huawei P30 Lite 128GB, Kártyafüggetlen, 1 Év Garanciával
- ÁRGARANCIA!Épített KomPhone i5 13400F 32/64GB RAM RX 7800 XT 16GB GAMER PC termékbeszámítással
- ÁRGARANCIA!Épített KomPhone i7 14700KF 32/64GB RAM RTX 5070 Ti 16GB GAMER PC termékbeszámítással
Állásajánlatok
Cég: FOTC
Város: Budapest