Jump to content


Photo

error msg please help


  • Please log in to reply
2 replies to this topic

#1 jvrothjr

jvrothjr
  • Members
  • PipPipPip
  • Advanced Member
  • 300 posts
  • LocationOhio

Posted 06 November 2003 - 08:05 PM

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
If you understand everything you know nothing!

http://rcchjr.awardspace.com/

#2 DylanBlitz

DylanBlitz
  • Members
  • PipPipPip
  • Advanced Member
  • 99 posts
  • LocationOC Baby!

Posted 06 November 2003 - 10:24 PM

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.

#3 jvrothjr

jvrothjr
  • Members
  • PipPipPip
  • Advanced Member
  • 300 posts
  • LocationOhio

Posted 07 November 2003 - 02:11 PM

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 .............
If you understand everything you know nothing!

http://rcchjr.awardspace.com/




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users