SA-MP Forums Archive
Print all Rows from a Field ( MYSQL ) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Print all Rows from a Field ( MYSQL ) (/showthread.php?tid=455058)



Print all Rows from a Field ( MYSQL ) - saamp - 31.07.2013

How can I print all rows from a field? The FieldName is pName.

pawn Код:
mysql_query("SELECT pName FROM dataBase");
mysql_store_result();

if(mysql_num_rows())
{
    while(mysql_retrieve_row())
    {
          // printf("%s", pName);
    }
}

mysql_free_result();



AW: Print all Rows from a Field ( MYSQL ) - CutX - 31.07.2013

Код:
SELECT `pName` FROM `database` WHERE `ID` != NULL
will select all names where the ID(assuming you've got a field named ID and they don't start with 0) is not 0


Re: AW: Print all Rows from a Field ( MYSQL ) - Sinner - 31.07.2013

Quote:
Originally Posted by CutX
Посмотреть сообщение
Код:
SELECT `pName` FROM `database` WHERE `ID` != NULL
will select all names where the ID(assuming you've got a field named ID and they don't start with 0) is not 0
0 is not the same as NULL!


Re: AW: Print all Rows from a Field ( MYSQL ) - saamp - 31.07.2013

Quote:
Originally Posted by CutX
Посмотреть сообщение
Код:
SELECT `pName` FROM `database` WHERE `ID` != NULL
will select all names where the ID(assuming you've got a field named ID and they don't start with 0) is not 0
I WANT TO PRINT THEM, NOT THE SELECT THEM, I KNOW HOW TO SELECT THEM!

Thanks anyway