...

View Full Version : help with Varchar(no#) result



DataTalk
12-24-2010, 07:05 PM
The query result from this script is a list of columns(FieldNames) in the table showing
VARCHAR (10)
VARCHAR (45)
etc.....

how would I get a result only showing the Varchar No# 45 without the column name and brackets. The result I am looking for is;
10
45
etc....



<?php
$query = "SHOW COLUMNS FROM $tablename";
$result = mysql_query($query);
while($columns = mysql_fetch_assoc($result)) {
echo "<br> $columns[Type]";
}
?>

DataTalk
12-24-2010, 07:48 PM
The query result from this script is a list of columns(FieldNames) in the table showing
VARCHAR (10)
VARCHAR (45)
etc.....

how would I get a result only showing the Varchar No# 45 without the column name and brackets. The result I am looking for is;
10
45
etc....



<?php
$query = "SHOW COLUMNS FROM $tablename";
$result = mysql_query($query);
while($columns = mysql_fetch_assoc($result)) {
echo "<br> $columns[Type]";
}
?>


How would I only allow numeric characters in the string? this might be one way to get the result... anyone?

PS: Merry Christmas to everyone!!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum