Foser Posted August 7, 2007 Share Posted August 7, 2007 <?php $list_query = mysql_query("SELECT * FROM item_info"); echo "<table width=\"200\" border=\"1\"><tr><th scope=\"col\">ID</th><th scope=\"col\">Name</th> <th scope=\"col\">Author</th><th scope=\"col\">Manage</th>"; while ($item_list = mysql_fetch_assoc($list_query)){ echo '<tr><th scope=\"col\">$item_list[item_id]</th> <th scope=\"col\">$item_list[item_name]</th><th scope=\"col\">$item_list[item_author]</th><th scope=\"col\"><a href=\"manage_item.php?item=$item_list[item_id]\">Manage</a></th>'; }?> When it outputs i all i see is the $item_list[item_id] and not the actual id... I also tried with {$variable}... but still didnt work Quote Link to comment https://forums.phpfreaks.com/topic/63710-solved-php-error-variables/ Share on other sites More sharing options...
Daniel0 Posted August 7, 2007 Share Posted August 7, 2007 Use double quotes and put curly brackets around the variables. That is needed when you are using arrays. Variables will only be parsed when enclosed in double quotes. Edit: You should also use single or double quotes around the array keys. Else you are using constants which is not what you intended. Edit 2: Without curly brackets is called simple syntax and with is called complex syntax (see http://php.net/string) Quote Link to comment https://forums.phpfreaks.com/topic/63710-solved-php-error-variables/#findComment-317477 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.