![]() |
how do i echo all rows in php?
Is there a way to show all rows in a database table without having to echo row[0] echo row [1] for each field?
did select * from blah where id=1 but theres about 50 fields (keyword tags) so can i just echo them all? |
It depends what you're using to get your data.
You could do Code:
foreach($data as $v) { Code:
$r = mysql_fetch_assoc($mysql_resource_link_doo_dar_thing); |
thx dude, ill give it a try
|
hmm cant figure it out, heres my code:
Code:
$alltags = mysql_query("SELECT * FROM tags WHERE user_id=$id"); |
Code:
while($row = mysql_fetch_array($alltags)) |
Quote:
And add: Code:
if($alltags === false) { And $id is definitely numeric isn't it? Code:
$id = preg_replace('/[^0-9]/', '', $id); |
that works good, thanks very much guys,
btw, is there anyway to skip the first field from echoing? since the first field is the id and i dont want to echo it. the 30 fields that follow are tags |
You could do it in MySQL, but I'd probably do it in the PHP as MySQL limits are usually what break things.
You could use an int to see where you are, like this: Code:
$c=0; |
thanks again
|
No problem. Anybody looking for a web developer, ICQ Me: 594086663 :)
|
Quote:
Thanks. |
All times are GMT -7. The time now is 02:52 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc