|
Тема |
Re: sh mi se prusne mozuka [re: AC] |
|
Автор |
Milenishte () |
|
Публикувано | 22.02.02 11:02 |
|
|
Ot manuala na PHP:
Only for SELECT statements mysql_query() returns a resource identifier or FALSE if the query was not executed correctly. For other type of SQL statements, mysql_query() returns TRUE on success and FALSE on error. A non-FALSE return value means that the query was legal and could be executed by the server. It does not indicate anything about the number of rows affected or returned. It is perfectly possible for a query to succeed but affect no rows or return no rows.
Gore-dolu shashtoto e i za mysql_db_query() ma taz funkcia e deprecated i po- dobre da polzvash mysql_query().
I oshte edno utochnenie - ako e vazmojno da imash nekolko ID-ta s edin i sasht email, tova koeto pravish shte ti varne samo parviq.
po dobre pravi slednoto - pak go ima v manual-a:
$usID = '';
$result = mysql_query("select usID from table") or die("Invalid query");
while ($row = mysql_fetch_array($result)) {
$usID .= "usID: ".$row["usID"];
}
if(empty($usID)) {
// nema zapis
} else {
// ima zapis
}
|
| |
|
|
|