jvrothjr Posted November 6, 2003 Share Posted November 6, 2003 We will try this in this forum. I have a database named [grouplog] with 2 tables {role & group} I can query the role and get data back and printed to the screen but can not get data back from group. Here is the simple code I am using if any one can help please? <table border=2 align=center><TD>Role</TD> <?php mysql_select_db (\"grouplog\"); $result = mysql_query (\"select role from role\"); while ($row=mysql_fetch_array($result)) { Print (\"<tr>\");print (\"<td>\");print $row[role];print (\"</td>\");print (\"</tr>\"); }?> </table> <table border=2 align=center><TD>Group</TD> <?php mysql_select_db (\"grouplog\"); $result = mysql_query (\"select group from group\"); while ($row=mysql_fetch_array($result)) { Print (\"<tr>\");print (\"<td>\");print $row[group];print (\"</td>\");print (\"</tr>\"); }?> </table> Here is the error msg I get Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:Program FilesAbyss Web Serverhtdocstestingtestgrp.php Quote Link to comment https://forums.phpfreaks.com/topic/1308-error-msg-please-help/ Share on other sites More sharing options...
DylanBlitz Posted November 6, 2003 Share Posted November 6, 2003 you can\'t use group as a table or field name. It is a reserved word and will not work right with queries. Try making a new table, tblgroup, with the field fldgroup and trying that. Quote Link to comment https://forums.phpfreaks.com/topic/1308-error-msg-please-help/#findComment-4340 Share on other sites More sharing options...
jvrothjr Posted November 7, 2003 Author Share Posted November 7, 2003 Thanks that was it. Was driving me crazy.......... changed it step 1 pasted now others thanks... pasted another topic for the other one. join multi tables from multi databases but all on one machine.... That is my next hump to get over ............. Quote Link to comment https://forums.phpfreaks.com/topic/1308-error-msg-please-help/#findComment-4363 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.