Jump to content

echo the field type


jeff5656

Recommended Posts

$query = "SELECT * FROM `people` WHERE `s_status` = 'a'  order by $srt";
$results = mysql_query ($query) or die (mysql_error());
while ($row = mysql_fetch_assoc ($results)) {
echo $row['f13'] . "this field type is"."?????";


Where the ???? are in the code above, what do I put there to echo the filed type (i.e. "varchar" or "Date", etc?

Link to comment
https://forums.phpfreaks.com/topic/199711-echo-the-field-type/
Share on other sites

I apologize I could not undertand how to use the first link:

for($count=0;$count<$fields;$count++) {

      $field = mysql_fetch_field($result,$count);

      echo "<p>$field->name $field->type ($field->max_length)</p>";

 

and apply that to my code.  what is "field ->type"??

 

If I have $row['f13'] how do I see what data type that is? 

 

Yoir send link: mysql_field_type(data,field_offset)

 

What is a field offset?  I do not know what number to start at. 

 

 

Link to comment
https://forums.phpfreaks.com/topic/199711-echo-the-field-type/#findComment-1048229
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.