Jump to content

[SOLVED] stripping numbers away from query


dennismonsewicz

Recommended Posts

Is there a way to manipulate a query to strip numbers out of a mysql query?

 

Here is some example code I have written:

 

$result = mysql_query("SELECT * FROM test") or die(mysql_error());
	$i = 0;
	$notallowed = "1234567890";
		while($i < mysql_num_fields($result)) {
			$meta = mysql_fetch_field(str_replace($notallowed, "", $result),$i);
			echo $i . ". " . $meta->name . "<br />";
			$i++;
			}

I thought it had to be an array...

 

I am displaying column names in my sql table but some of the columns contain numbers, IE(Name1, Name2).

 

I am wanting to strip out the 1, 2, 3, 4... or whatever number it happens to be.

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.