Jump to content

Recommended Posts

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?

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.

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
		);

?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.