My first program . I have a three column table with entries in the first two and NULL in the third col.
I tried (from c++)
while( ( row = mysql_fetch_row(result) ) != NULL)
{
printf("id: %s,val: %s, name: %s\n",(row[0]?row[0]: "NULL"),(row[1]? row[1]:"NULL" ) ,(row[2]?row[2]: "NULL" ));
}
and its weird because I got
id: 1,val: A, name: ?
2
id: 2,val: A, name: 3
id: 3,val: C, name: 4
id: 4,val: B, name:
id: 5,val: B, name:
which is an exact view of what I see. I expected the word "NULL" to be there in the last column since I left that column blank.
ANy ideas why the value of row[2] is coming back with such odd values as 2, 3 when in actuality I put nothing in that column when I created the database.
Many thanks.
I tried (from c++)
while( ( row = mysql_fetch_row(result) ) != NULL)
{
printf("id: %s,val: %s, name: %s\n",(row[0]?row[0]: "NULL"),(row[1]? row[1]:"NULL" ) ,(row[2]?row[2]: "NULL" ));
}
and its weird because I got
id: 1,val: A, name: ?
2
id: 2,val: A, name: 3
id: 3,val: C, name: 4
id: 4,val: B, name:
id: 5,val: B, name:
which is an exact view of what I see. I expected the word "NULL" to be there in the last column since I left that column blank.
ANy ideas why the value of row[2] is coming back with such odd values as 2, 3 when in actuality I put nothing in that column when I created the database.
Many thanks.