Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
PHP trouble
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Off the Wall
View previous topic :: View next topic  
Author Message
gsfgf
Veteran
Veteran


Joined: 08 May 2002
Posts: 1266

PostPosted: Mon May 05, 2003 2:08 am    Post subject: PHP trouble Reply with quote

I have an array that gets info froma database. When i var_dump it i get
Code:

object(stdClass)(6) { ["pkgname"]=>  string(11) "sys-libs/db" ...

however when I var_dump $a_row[pkgname], i get NULL. Why is this?

---

How can i easily convert data storeed in the db w/ \n to define a new line to HTML with <br> to define a newline?
_________________
Aim:gsfgf0
Back to top
View user's profile Send private message
Rider
Tux's lil' helper
Tux's lil' helper


Joined: 07 Jan 2003
Posts: 85
Location: Berne, Switzerland

PostPosted: Mon May 05, 2003 6:37 am    Post subject: Re: PHP trouble Reply with quote

gsfgf wrote:

How can i easily convert data storeed in the db w/ \n to define a new line to HTML with <br> to define a newline?


you could use the nl2br function:
http://www.php.net/manual/en/function.nl2br.php
Back to top
View user's profile Send private message
gsfgf
Veteran
Veteran


Joined: 08 May 2002
Posts: 1266

PostPosted: Mon May 05, 2003 12:02 pm    Post subject: Reply with quote

one more (in addition to the array question above)
when i use
Code:
if(mysql_fetch_array($result))

to see if a row exists, the script dies if it does(says $result doens't hold a valid recordset). All i want is for it to return true if it finds one and false if it doesn't. Is there a different way to do this? I'm just checking to make sure they're no dupes.
_________________
Aim:gsfgf0
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Off the Wall All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum