Print all Rows from a Field ( MYSQL )
#1

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();
Reply
#2

Код:
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
Reply
#3

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!
Reply
#4

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)