| View previous topic :: View next topic |
| Author |
Message |
gsfgf Veteran


Joined: 08 May 2002 Posts: 1266
|
Posted: Mon May 05, 2003 2:08 am Post subject: PHP trouble |
|
|
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 |
|
 |
Rider Tux's lil' helper

Joined: 07 Jan 2003 Posts: 85 Location: Berne, Switzerland
|
Posted: Mon May 05, 2003 6:37 am Post subject: Re: PHP trouble |
|
|
| 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 |
|
 |
gsfgf Veteran


Joined: 08 May 2002 Posts: 1266
|
Posted: Mon May 05, 2003 12:02 pm Post subject: |
|
|
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 |
|
 |
|