473,395 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Need help with implode function

I have a set of values that were put into a form and am now using this to put into a database. this is my error:

"Warning: implode() [function.implode]: Bad arguments. in /home/xxxxxx/public_html/login.php on line 177
Couldn't execute insert query."

[PHP]
$today = date("Y-m-d");
$fields_str = implode(",",$fields);
$values_str = implode('","',$values); <=line 177
$fields_str .=",createdate";
$values_str .='"'.",".'"'.$today;
$fields_str .=",password";
$values_str .= '"'.","."md5"."('".$password."')";
$sql = "INSERT INTO member ";
$sql .= "(".$fields_str.")";
$sql .= " VALUES ";
$sql .= "(".'"'.$values_str.")";
$result = mysql_query($sql,$con)
or die("Couldn't execute insert query.");
$_SESSION['auth']="yes";
$_SESSION['logname'] = $loginname;
[/PHP]
May 30 '07 #1
1 2338
Atli
5,058 Expert 4TB
$values_str = implode('","',$values); <=line 177
Hi.

Try replacing the '","' with ','
May 30 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Shawn Campbell | last post by:
Here's my scenario: I'm creating a build environment with one system acting as the main build dispatcher and other systems as the build hosts. On the main build system I have Apache, MySQL and...
0
by: kf4pfw | last post by:
Hi: I have a form with 4 arrays in it. Each array can contain up to 11 elements. I am using the following code (this is for proof of concept): <? if($submit) {
1
by: Martin Klaffenboeck | last post by:
Hello! I would like to know how I can work with a PHP Array and a set. How can i get all rows where a set where at least one item oft the php Array is inside the set column? Thanks, Martin
4
by: Stephen Kay | last post by:
Maybe I don't understand how to use this yet, but I was using (example): $html = implode('', file('http://www.mysite.com/transbar.html')); echo $html; This works. But if I try it on a...
0
by: peaforabrain | last post by:
I've been messing about with a function to get a text block to not blow its sides. I need it to be 29 characters wide and 3 lines high only. I have'nt had much success with the standard php...
6
by: TheRealDan | last post by:
Hi all. I'm having a problem with a special characters. I have php script that reads from an xml file and writes to a mysql db. It's a script called phptunest that I found on the net, although the...
4
by: atyndall | last post by:
OK, this is the relevant portion script: <?php $username = '__'; // MySQL Database Username. $password = '__'; // MySQL Database Password. $server = '__'; // MySQL Database server (most...
5
by: swethak | last post by:
hi, i want to zip the folder using php. Any body plz help for that.
6
by: tokcy | last post by:
Hi, I am having a problem with implode() function in PHP. whenever i am running my code it display an error like. Warning: implode() : Bad arguments. in D:\xampp\htdocs\admin\addspecs.php on...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.