Thanks for the information, I will try that in this situation, however, I have done this in other select statements and it has worked fine. I will follow-up in the PHP list if I still have problems.
Please note also that since I assumed this was a MySQL problem I posted it to this group. Since these two programs are so closely interlinked, it is hard for us newbies to tell where the problem may lie. I have in the past posted a question to both groups as I wasn't sure of it either. These lists are for those that know and those that don't and both have to be tolerant of the other. Beauford ----- Original Message ----- From: "Basil Hussain" <[EMAIL PROTECTED]> To: "C. Reeve" <[EMAIL PROTECTED]>; "MySQL List" <[EMAIL PROTECTED]> Sent: Wednesday, December 18, 2002 11:57 AM Subject: RE: $Variables and Select statements > Hi, > > > while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { > > > > echo "<TR WIDTH=150><TD > > ALIGN=left>".$line['name']."</TD><TD > > ALIGN=right>".$line['$wk']."</TD>"; > > > > } > > Here is your problem. Your are indeed substituting $wk into the query > correctly, but when you go to output the result rows you are not. > > You should simply remove the quote marks from: > > $line['$wk'] > > so that it is: > > $line[$wk] > > PHP does not interpret variable names in single-quoted strings - only in > double-quoted strings. With your current code, PHP is only looking for an > array element called '$wk', which doesn't exist! > > In future, may I suggest you that post questions like this to the PHP > mailing list, as this is nothing to do with MySQL. > > Regards, > > Basil Hussain > --------------------------------------- > Internet Developer, Kodak Weddings > E-Mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- > Before posting, please check: > http://www.mysql.com/manual.php (the manual) > http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> > To unsubscribe, e-mail <[EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > > --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php