User not logged in - login - register
Home Calendar Books School Tool Photo Gallery Message Boards Users Statistics Advertise Site Info
go to bottom | |
 Message Boards » » PHP Help? Page [1]  
RhoIsWar1096
All American
3857 Posts
user info
edit post

So I'm working on a website and having some strange errors showing up:

Quote :
"
Warning: implode() [function.implode]: Bad arguments. in /home/strattap/public_html/bottomsup/admin/createuser.php on line 166

Warning: implode() [function.implode]: Bad arguments. in /home/strattap/public_html/bottomsup/admin/createuser.php on line 167
Couldn't execute insert query.
"


Here are the original statements:
Quote :
"
$fields_str = implode(",",$fields);
$values_str = implode('","',$values);
"


And here's what I found about implode:
http://us.php.net/implode

Any suggestions?

12/26/2007 6:13:00 PM

BigMan157
no u
103352 Posts
user info
edit post

are you sure the $fields and $values arrays exist?

12/26/2007 7:47:59 PM

Noen
All American
31346 Posts
user info
edit post

yeup ^ is right. You are getting bad data in your string functions. you need to do some data checking before calling implode, especially boundary conditions (null strings, escaping characters)

12/26/2007 7:53:38 PM

RhoIsWar1096
All American
3857 Posts
user info
edit post

Ya know, I had a sneaking suspicion that was it... I guess I should just make sure the array has index >= 2 before imploding it?

12/26/2007 9:56:33 PM

 Message Boards » Tech Talk » PHP Help? Page [1]  
go to top | |
Admin Options : move topic | lock topic

© 2024 by The Wolf Web - All Rights Reserved.
The material located at this site is not endorsed, sponsored or provided by or on behalf of North Carolina State University.
Powered by CrazyWeb v2.38 - our disclaimer.