glenelkins Posted November 1, 2007 Share Posted November 1, 2007 Hi Im using the following code to describe a database table. It works perfectly fine when echo() is used to display field titles, but no code after the loop is running: $result = mysql_query ( "DESCRIBE `test`" ); while ( $r = mysql_fetch_array ( $result ) ) { extract ( $r ); echo "$Field<br>"; } echo "bla bla"; <---- this code doesn't run! Ideas? Link to comment https://forums.phpfreaks.com/topic/75627-solved-code-wont-continue-after-while-loop/ Share on other sites More sharing options...
Barand Posted November 1, 2007 Share Posted November 1, 2007 I ran your code on a couple of my own tables and it runs flawlessly ??? Something weird about the actual string you are echoing, maybe? Have you tried "View source", it may be there but not appearing. Link to comment https://forums.phpfreaks.com/topic/75627-solved-code-wont-continue-after-while-loop/#findComment-382679 Share on other sites More sharing options...
glenelkins Posted November 1, 2007 Author Share Posted November 1, 2007 Well its just rather strange, here is the actual code... the loop does run but when I echo out the $table var nothing happens: <?php // Companies list page variables // We need to get the fields for this page // from the database table company_details $cl_result = $this->database->db_query ( "DESCRIBE `company_details`" ); // Loop through fields $table = $this->functions->tables->generate_table_top (); $table .= $this->functions->tables->start_table_row(); while ( $cl = $this->database->db_fetch_array ( $cl_result ) ) { extract ( $cl ); $table .= $this->functions->tables->generate_table_data ( $Field, "font-weight: bold;" ); } $table .= $this->functions->tables->close_table_row(); $table .= $this->functions->tables->generate_table_bottom(); // Send the vars $vars = array( 'Title' => 'Pops - Companies List', 'Content' => $table ); ?> Link to comment https://forums.phpfreaks.com/topic/75627-solved-code-wont-continue-after-while-loop/#findComment-382685 Share on other sites More sharing options...
glenelkins Posted November 1, 2007 Author Share Posted November 1, 2007 Hi It was my fetch_array function that was the issue! Link to comment https://forums.phpfreaks.com/topic/75627-solved-code-wont-continue-after-while-loop/#findComment-382699 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.