$username Posted January 20, 2008 Share Posted January 20, 2008 Hello All, So I am working on making some code a var in PHP but it will not load correctly (not at all) If some one could tell me if this can be done with php. $AccountList = while($row = mysql_fetch_array($query)) { "<table> <tr> <th><strong>Account ID:</strong></th> <th><strong>Account Name</strong></th> </tr> <tr>" "<th><a href=\"viewaccount.php?AccNum=".$row["AccountNumber"]."\" title=\"".$row["AccountID"]."\">".$row["AccountID"]."</a></th>" "<th>".$row['AccountName']."</th> </tr> </table>"}; Thank you, Brett Link to comment https://forums.phpfreaks.com/topic/86911-solved-php-var-not-working/ Share on other sites More sharing options...
kenrbnsn Posted January 20, 2008 Share Posted January 20, 2008 You can not have a while statement as you have shown it. What do you want to do exactly? Ken Link to comment https://forums.phpfreaks.com/topic/86911-solved-php-var-not-working/#findComment-444328 Share on other sites More sharing options...
$username Posted January 20, 2008 Author Share Posted January 20, 2008 I would like to make all that one var so that I can call it later when needed. Brett Link to comment https://forums.phpfreaks.com/topic/86911-solved-php-var-not-working/#findComment-444329 Share on other sites More sharing options...
Bauer418 Posted January 20, 2008 Share Posted January 20, 2008 $accountList = ''; while ($row = mysql_fetch_array($query)) { $accountList .= "<table> <tr> <th><strong>Account ID:</strong></th> <th><strong>Account Name</strong></th> </tr> <tr> <th><a href=\"viewaccount.php?AccNum=".$row["AccountNumber"]."\" title=\"".$row["AccountID"]."\">".$row["AccountID"]."</a></th> <th>".$row['AccountName']."</th> </tr> </table>"; } print $accountList; Link to comment https://forums.phpfreaks.com/topic/86911-solved-php-var-not-working/#findComment-444330 Share on other sites More sharing options...
$username Posted January 20, 2008 Author Share Posted January 20, 2008 Wow Bauer418 for only 3 post you are pretty good. Thank you that fixed me up. Link to comment https://forums.phpfreaks.com/topic/86911-solved-php-var-not-working/#findComment-444334 Share on other sites More sharing options...
Bauer418 Posted January 20, 2008 Share Posted January 20, 2008 I have gone through three accounts on this site already. I'm well over a cumulative of 5,000 by now. Anyways, if this solved your issue, make sure to click the solved button and mark this post as solved. Link to comment https://forums.phpfreaks.com/topic/86911-solved-php-var-not-working/#findComment-444336 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.