Solved

php PDO INSERT not working

Posted on 2013-06-19
36
908 Views
Last Modified: 2013-07-06
Greetings,
   I am working on a site for the buying, selling and trading of items.  I am trying to get the php/mysql query to work using PDO, which is very new to me (the PDO that is), but I am determined to get it to work.  I have a form where user can post an item for sale.  The form appears to be passing the posted info to the processing form.  The uploaded images are processed and put into correct folder.  Everything works as it should, except it is not inserting the posted info into the db.  I have tested the db connection and am getting a connection, but no Insert.  I have attached the code for the form processing.  Maybe a fresh set of eyes will do better than I.  I been working on this for over two days straight and getting nowhere.

Just for clarity, my server is a Linux, running mysql 5.1.49 and PHP 5.2 and yes, the PDO drivers are installed.  I am using this exact code on another site, with no problems. But in this instance, it's a no-go.
postsaleitem-ee.php
0
Comment
Question by:larrywish
  • 13
  • 11
  • 5
  • +4
36 Comments
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
Looks like you need to add errorInfo(); http://us2.php.net/manual/en/pdostatement.errorinfo.php after your execute() statement to see what is going on.
0
 
LVL 75

Expert Comment

by:Michel Plungjan
Comment Utility
Apart from the very high level of repetition, I would expect the insert to have back ticks as in

INSERT INTO saleitems ( `itemid`, `uname`, .... and so on
0
 
LVL 25

Expert Comment

by:kevp75
Comment Utility
Are you getting any errors?  Also, can you show us how you are instantiating your PDO handle?

Your query looks right, and the execution looks correct, so I am thinking that it may be something in the handle preventing this, or not showing you the error that could be occuring.
0
 
LVL 17

Expert Comment

by:jrm213jrm213
Comment Utility
Hi,

You didn't state how you knew that insert was failing. When you assign q to the connection prepare it returns a PDO::Statement object. You then execute that, but q is still a PDO:Statement object. Your comparison of if(q) to determine if it was successful or not is incorrect. The execute function returns a boolean so if you are solely going by that last statement to determine if the insert was successful or not then you need to change your code

$sql = "INSERT INTO saleitems ( itemid, uname, accounttype, listtime, listtype, sellerid, selleremail, itemzip, itemname, numitems, itemcat, itemdescrip, itemimage1, itemimage1sm, itemimage2, itemimage2sm, itemimage3, itemimage3sm, itemimage4, itemimage4sm, itemimage5, itemimage5sm, itemprice, sellercontact, sellerphone) VALUES (:itemid, :uname, :accounttype, :listtime, :listtype, :sellerid, :selleremail, :itemzip, :itemname, :numitems, :itemcat, :itemdescrip, :new_itemimage1, :new_itemimage1sm, :new_itemimage2, :new_itemimage2sm, :new_itemimage3, :new_itemimage3sm, :new_itemimage4, :new_itemimage4sm, :new_itemimage5, :new_itemimage5sm, :itemprice, :sellercontact, :sellerphone)";
$q = $conn->prepare($sql);
$res = $q->execute(array(
':itemid'=>$itemid, 
':uname'=>$uname, 
':accounttype'=>$accounttype, 
':listtime'=>$listtime,
':listtype'=>$listtype, 
':sellerid'=>$sellerid, 
':selleremail'=>$selleremail, 
':itemzip'=>$itemzip, 
':itemname'=>$itemname,
':numitems'=>$numitems, 
':itemcat'=>$itemcat, 
':itemdescrip'=>$itemdescrip, 
':itemimage1'=>$new_itemimage1,
':itemimage1sm'=>$new_itemimage1sm, 
':itemimage2'=>$new_itemimage2, 
':itemimage2sm'=>$new_itemimage2sm,
':itemimage3'=>$new_itemimage3, 
':itemimage3sm'=>$new_itemimage3sm, 
':itemimage4'=>$new_itemimage4,
':itemimage4sm'=>$new_itemimage4sm, 
':itemimage5'=>$new_itemimage5,
':itemimage5sm'=>$new_itemimage5sm,
':itemprice'=>$itemprice, 
':sellercontact'=>$sellercontact, 
':sellerphone'=>$sellerphone));


if($res) {
echo "Item post successful.";
}else{
echo "Item post failed.";
}

Open in new window

0
 

Author Comment

by:larrywish
Comment Utility
Thanks jrm213jrm213,
   I plugged your code in and this is what I got back.

 Database connection successful....

Warning: PDOStatement::execute() [pdostatement.execute]: SQLSTATE[HY093]: Invalid parameter number: parameter was not defined in /home/www/yarksale.com/dev/postsaleitem.php on line 645
Item post failed.

Line 645 is this line,
':sellerphone'=>$sellerphone));

As you can see, I getting a db connection, so I don't think that's the problem.  No matter which way I go about it, this is what I get.  However, I have checked my parameters.  I have 25 variables, with 25 matching values, so I'm not sure where this "Invalid parameter number" is coming from.
0
 
LVL 17

Expert Comment

by:jrm213jrm213
Comment Utility
in your query you have your parameters for the itemimage1 etc named ":new_itemimage1" but in your array you just have ":itemimage1"

add new_ to all the itemimage parameters in your array.

$q->execute(array(
':itemid'=>$itemid, 
':uname'=>$uname, 
':accounttype'=>$accounttype, 
':listtime'=>$listtime,
':listtype'=>$listtype, 
':sellerid'=>$sellerid, 
':selleremail'=>$selleremail, 
':itemzip'=>$itemzip, 
':itemname'=>$itemname,
':numitems'=>$numitems, 
':itemcat'=>$itemcat, 
':itemdescrip'=>$itemdescrip, 
':new_itemimage1'=>$new_itemimage1,
':new_itemimage1sm'=>$new_itemimage1sm, 
':new_itemimage2'=>$new_itemimage2, 
':new_itemimage2sm'=>$new_itemimage2sm,
':new_itemimage3'=>$new_itemimage3, 
':new_itemimage3sm'=>$new_itemimage3sm, 
':new_itemimage4'=>$new_itemimage4,
':new_itemimage4sm'=>$new_itemimage4sm, 
':new_itemimage5'=>$new_itemimage5,
':new_itemimage5sm'=>$new_itemimage5sm,
':itemprice'=>$itemprice, 
':sellercontact'=>$sellercontact, 
':sellerphone'=>$sellerphone));

Open in new window

0
 
LVL 25

Expert Comment

by:kevp75
Comment Utility
check to see if it's null
0
 

Author Comment

by:larrywish
Comment Utility
Thanks for the response,
  However, the problem with that is that the db table field is name itemimage1, itemimage1sm, etc.  The new_itemimage1, etc are the new values to insert into the table.  So changing the variable name would just cause me further issues.
0
 
LVL 17

Accepted Solution

by:
jrm213jrm213 earned 125 total points
Comment Utility
No the values in the array have nothing to do with the fields in the database.

The SQL Statement includes the fields to be updated by name

$sql = "INSERT INTO saleitems ( itemid, uname, accounttype, listtime, listtype, sellerid, selleremail, itemzip, itemname, numitems, itemcat, itemdescrip, itemimage1, itemimage1sm, itemimage2, itemimage2sm, itemimage3, itemimage3sm, itemimage4, itemimage4sm, itemimage5, itemimage5sm, itemprice, sellercontact, sellerphone)

Open in new window


Then you tell it what values, and you are using an associative array
VALUES (:itemid, :uname, :accounttype, :listtime, :listtype, :sellerid, :selleremail, :itemzip, :itemname, :numitems, :itemcat, :itemdescrip, :new_itemimage1, :new_itemimage1sm, :new_itemimage2, :new_itemimage2sm, :new_itemimage3, :new_itemimage3sm, :new_itemimage4, :new_itemimage4sm, :new_itemimage5, :new_itemimage5sm, :itemprice, :sellercontact, :sellerphone)";

Open in new window


The names in the values could be anything, it's their order that is important.

for example in the values statement if you switched ":itemid, :uname" to ":uname, :itemid" but did not change " ( itemid, uname," to " ( uname, itemid," in the first part of the sql statement, it would try to insert :uname into itemid and :itemid into uname.

It's the order that is important. Those values :itemid etc, get replaced by pdo with the corresponding value from the associative array.
0
 
LVL 17

Expert Comment

by:jrm213jrm213
Comment Utility
to simplify if you have this statement

"insert into mytable (idnumber, username) values (:id, :name)"

and this array

array(':id'=>12,':name'=>"jay");

PDO will execute the statement as if it were written like

insert into mytable (idnumber, username) values (12,jay)
0
 

Author Comment

by:larrywish
Comment Utility
Okay, I think I get it.  This whole PDO thing is really confusing to me.  I am so used to the regular old mysql way, that it is really hard for me to get my head around it.  Plus it doesn't help when all the tutorials and forum examples are all different.  No two ways are the same.  It is like there is not a standardized way of doing it.  That is what is maddening.   I'll let you know what happens when I make the suggested correction.
0
 
LVL 17

Expert Comment

by:jrm213jrm213
Comment Utility
in the same way you can use PDO with placeholders, which is what I normally do

"insert into mytable (idnumber, username) values (?,?)"

with an array like
array(12,"jay");

PDO takes the array elements and replaces the ?'s in the statement with the values from the array. So array first position goes into ? first position, array second position goes into ? second position.
0
 
LVL 25

Assisted Solution

by:kevp75
kevp75 earned 125 total points
Comment Utility
Try this on for size:
<?php

$conn = null;
$dsn = array("mysql:host=YOUR_HOST;dbname=YOUR_DB_NAME", $YOUR_DB_USER, $YOUR_DB_PASSWORD);

try{
	// Set out internal db handle with the dsn values from above
	$conn = new PDO($dsn[0], $dsn[1], $dsn[2]);
	// if the db type is mySQL, set some attributes
	$conn->setAttribute(PDO::ATTR_PERSISTENT, true);
	$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
	$conn->setAttribute(PDO::MYSQL_USE_BUFFERED_QUERY, true);
	unset($dsn);
} catch (PDOException $e) {
	// this should catch any error that may occur when trying to set our handle
	echo $e->getMessage();
	exit;
}

$params = array($itemid, $uname, $accounttype, $listtime, $listtype, $sellerid, $selleremail, $itemzip, $itemname, $numitems, 
						 $itemcat, $itemdescrip, $new_itemimage1, $new_itemimage1sm, $new_itemimage2, $new_itemimage2sm, $new_itemimage3, $new_itemimage3sm, $new_itemimage4, $new_itemimage4sm, 
						 $new_itemimage5, $new_itemimage5sm, $itemprice, $sellercontact, $sellerphone);

$sql = "INSERT INTO `saleitems` 
		(`itemid`, `uname`, `accounttype`, `listtime`, `listtype`, `sellerid`, `selleremail`, `itemzip`, `itemname`, `numitems`, 
		`itemcat`, `itemdescrip`, `itemimage1`, `itemimage1sm`, `itemimage2`, `itemimage2sm`, `itemimage3`, `itemimage3sm`, `itemimage4`, `itemimage4sm`, 
		`itemimage5`, `itemimage5sm`, `itemprice`, `sellercontact`, `sellerphone`) 
		VALUES 
		(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
$q = $conn->prepare($sql);
BindParameters($q, $params);
$res = $q->execute($params);


if($res) {
	echo "Item post successful.";
}else{
	echo "Item post failed.";
}



// Prepare and bind our parameters
function BindParameters($Stmnt, $Params){
	// loop over params, grab the length, datatype, and value
	$pCt = count($Params);
	for($i = 0; $i < $pCt; ++$i){
		switch(strtolower(gettype($Params[$i]))){
			case 'boolean':
				$Stmnt->bindParam('?', $Params[$i], PDO::PARAM_BOOL);	
				break;
			case 'integer':
			case 'double':
			case 'float':
				$Stmnt->bindParam('?', $Params[$i], PDO::PARAM_INT);	
				break;
			case 'null':
				$Stmnt->bindParam('?', $Params[$i], PDO::PARAM_NULL);	
				break;
			default:
				$Stmnt->bindParam('?', $Params[$i], PDO::PARAM_STR, strlen($Params[$i]));	
		}
	}
}

?>

Open in new window



(yes, tested...  PHP 5.4 and MySql 5.2 though)
0
 
LVL 108

Assisted Solution

by:Ray Paseur
Ray Paseur earned 125 total points
Comment Utility
Have a look at this article. It shows some parallel construction between MySQL, MySQLi and PDO.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/PHP_Databases/A_11177-PHP-MySQL-Deprecated-as-of-PHP-5-5-0.html
0
 

Author Comment

by:larrywish
Comment Utility
I tried the code above and got "Item post failed".
0
 

Author Comment

by:larrywish
Comment Utility
I am reading the article now.  See you on the back side.
0
 
LVL 25

Expert Comment

by:kevp75
Comment Utility
@larrywish.  This means that there is something wrong with your query, please make sure that all fields are correct and match the table in the database.
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 25

Expert Comment

by:kevp75
Comment Utility
see if this will report anything further than just the "post failed" message.
<?php

$conn = null;
$dsn = array("mysql:host=YOUR_HOST;dbname=YOUR_DB_NAME", $YOUR_DB_USER, $YOUR_DB_PASSWORD);

try{
	// Set out internal db handle with the dsn values from above
	$conn = new PDO($dsn[0], $dsn[1], $dsn[2]);
	// if the db type is mySQL, set some attributes
	$conn->setAttribute(PDO::ATTR_PERSISTENT, true);
	$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
	$conn->setAttribute(PDO::MYSQL_USE_BUFFERED_QUERY, true);
	unset($dsn);
} catch (PDOException $e) {
	// this should catch any error that may occur when trying to set our handle
	echo $e->getMessage();
	exit;
}

$params = array($itemid, $uname, $accounttype, $listtime, $listtype, $sellerid, $selleremail, $itemzip, $itemname, $numitems, 
						 $itemcat, $itemdescrip, $new_itemimage1, $new_itemimage1sm, $new_itemimage2, $new_itemimage2sm, $new_itemimage3, $new_itemimage3sm, $new_itemimage4, $new_itemimage4sm, 
						 $new_itemimage5, $new_itemimage5sm, $itemprice, $sellercontact, $sellerphone);

$sql = "INSERT INTO `saleitems` 
		(`itemid`, `uname`, `accounttype`, `listtime`, `listtype`, `sellerid`, `selleremail`, `itemzip`, `itemname`, `numitems`, 
		`itemcat`, `itemdescrip`, `itemimage1`, `itemimage1sm`, `itemimage2`, `itemimage2sm`, `itemimage3`, `itemimage3sm`, `itemimage4`, `itemimage4sm`, 
		`itemimage5`, `itemimage5sm`, `itemprice`, `sellercontact`, `sellerphone`) 
		VALUES 
		(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
$q = $conn->prepare($sql);
BindParameters($q, $params);
$res = $q->execute($params);


if($res) {
	echo "Item post successful.";
}else{
	echo "Item post failed.";
	print_r($conn->errorInfo());
}



// Prepare and bind our parameters
function BindParameters($Stmnt, $Params){
	// loop over params, grab the length, datatype, and value
	$pCt = count($Params);
	for($i = 0; $i < $pCt; ++$i){
		switch(strtolower(gettype($Params[$i]))){
			case 'boolean':
				$Stmnt->bindParam('?', $Params[$i], PDO::PARAM_BOOL);	
				break;
			case 'integer':
			case 'double':
			case 'float':
				$Stmnt->bindParam('?', $Params[$i], PDO::PARAM_INT);	
				break;
			case 'null':
				$Stmnt->bindParam('?', $Params[$i], PDO::PARAM_NULL);	
				break;
			default:
				$Stmnt->bindParam('?', $Params[$i], PDO::PARAM_STR, strlen($Params[$i]));	
		}
	}
}

?>

Open in new window

0
 

Author Comment

by:larrywish
Comment Utility
thanks kevp75, I got blank return.  Nothing.
0
 
LVL 25

Expert Comment

by:kevp75
Comment Utility
can you post a 'CREATE TABLE' statement for the table related to this query?  I want to attempt it via your structure vs. mine.
0
 
LVL 33

Assisted Solution

by:Slick812
Slick812 earned 125 total points
Comment Utility
greetings  larrywish, I hope this helps, but I can not see any where your code should fail, if you get Line-Number error reports like -
dev/postsaleitem.php on line 645
you should be able to change that line (sometimes it's the line above that has BAD syntax) to remove the error, OR for debug,, completely remove that line if the code does not DEPEND on that line. I have had countless problems with Mis-Spelling of the placeholders,

I have given up on using the PDO "one size fits all" database wrapper, due to unfounded errors like this, and due to the Default setting that tells it to only "Simulate" the prepare and execute for MySQL, although you use the prepare code it does NOT do the MySQLI improved prepare, it will do the OLD standard QUERY and merely do the OLD Mysql Escape string on the input placeholder variables like  :sellerid , it does this even in PHP 5.4 where there is no OLD Mysql.

as to your problem, there are some reports the the maximum placeholder variables (alias) like  :sellerid is 16, if you have 17 or more placeholders, then there may be unpredictable problems, but some say this was fixed in a newer version.

for debugging you may have to chop down the code until you get something that works,  and then add a line at a time to see where it starts to fail, you might try a shorter array for execute -
$q->execute(array(
':itemid'=>$itemid, 
':uname'=>$uname, 
':accounttype'=>$accounttype, 
':listtime'=>$listtime,
':listtype'=>$listtype, 
':sellerid'=>$sellerid, 
':selleremail'=>$selleremail, 
':itemzip'=>$itemzip, 
':itemname'=>$itemname,
':numitems'=>$numitems, 
':itemcat'=>$itemcat, 
':itemdescrip'=>$itemdescrip));

Open in new window

and see if that works, you will also have to change the INSERT to reflect the shorten VALUES options, ,  If that works then add a couple three VALUE Items until it don't work.

You may be better of using the MySQL Improved prepare and execute instead of the PDO, in  MySQL Improved code you will have More Options and factors to use, that are not included in the PDO due to a "one size fits all" reduction of options.
0
 

Author Comment

by:larrywish
Comment Utility
Slick812,
  Thanks for you thoughtful response. I don't think the number of inputs is the problem.  Here is what is maddening.  I have the PDO working on another site just fine, and it has 130 inputs, not just the 24 I have above.  So that is why I don't think it is the quantity of inputs.  I haven't really looked into mysqli.  I guess I read somewhere that it would be next on the chopping block, after mysql.  So I am trying to stick with PDO, so that in the years to come, I won't have to worry about my code suddenly not working.  

 And yes, I have tried to simply copy the code over from the working PDO, into this.  That would only be logical.  But still no go.  They are all on the same server, so that's not the problem either.   Oh well, I press on.
0
 

Author Comment

by:larrywish
Comment Utility
kevp75,
  Here is the table create structure you requested.

CREATE TABLE IF NOT EXISTS `saleitems` (
  `sellerid` bigint(20) NOT NULL,
  `selleremail` varchar(150) NOT NULL,
  `itemname` varchar(75) NOT NULL,
  `itemid` varchar(50) NOT NULL,
  `numitems` varchar(5) NOT NULL,
  `itemcat` varchar(50) NOT NULL,
  `itemdescrip` varchar(100) NOT NULL,
  `itemimage1` varchar(30) NOT NULL,
  `itemimage1sm` varchar(30) NOT NULL,
  `itemimage2` varchar(30) NOT NULL,
  `itemimage2sm` varchar(30) NOT NULL,
  `itemimage3` varchar(30) NOT NULL,
  `itemimage3sm` varchar(30) NOT NULL,
  `itemimage4` varchar(30) NOT NULL,
  `itemimage4sm` varchar(30) NOT NULL,
  `itemimage5` varchar(30) NOT NULL,
  `itemimage5sm` varchar(30) NOT NULL,
  `itemzip` int(5) NOT NULL,
  `itemtrade1` varchar(200) NOT NULL,
  `itemtrade2` varchar(200) NOT NULL,
  `itemprice` varchar(15) NOT NULL,
  `sellercontact` varchar(10) NOT NULL,
  `sellerphone` varchar(15) NOT NULL,
  `uname` varchar(20) NOT NULL,
  `listtime` varchar(50) NOT NULL,
  `listtype` varchar(6) NOT NULL,
  PRIMARY KEY (`itemid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
0
 
LVL 33

Expert Comment

by:Slick812
Comment Utility
@larrywish, , as to your statement -  " I haven't really looked into mysqli.  I guess I read somewhere that it would be next on the chopping block, after mysql."
I would say that this is completely UNTRUE, No WAY, as the PDO uses the PHP MySQL (or mysqli in 5.4)  code for ALL of it's operations on a MySQL database, > > So if it was decided for PHP to Chop off ALL MySQL (including the mysqli) then there would be millions of Web sites that COULD not work at all, there is no way this will happen, The adoption of PHP 5.4 without MySQL will probably not happen much either for a long while, because millions of sites have PHP code using the Old MySQL, A server I am working on, that I choose to use 5.4, has an option to pick PHP ver 5.3 or 5.4, I asked the tech support there, and they said only a very few chose 5.4 , because all of their code and many of the Frameworks (Joomla, etc.) depend on the old MySQL.  
 You should have gotten a clue about PDO not being so good, since there are so many differences in the way execute( ) can be called, and as you said - "Plus it doesn't help when all the tutorials and forum examples are all different.  No two ways are the same";
if you are running in a PHP 5.2, what is your worry?

You also say - "They are all on the same server, so that's not the problem either", and yet you have the problem? It may be a server thing and not a PHP PDO thing?
That's all I have to say, wish I could help, but if your code looks correct, what can I do to help, , Not A Thing.
0
 

Author Comment

by:larrywish
Comment Utility
Slick812,
 Thanks.  I didn't mean to imply that I heard mysql or mysqli was being chopped, just those as a system of command structures.  I understand that PDO runs on mysql servers, along with many others.  

It may be better for me to make the switch to mysqli, since it is probably closer to what I am used to running.  Then maybe down the road, tackle the PDO thing again, when I'm not in the middle of production efforts.  

  Thanks again, and have a good one.
0
 
LVL 25

Expert Comment

by:kevp75
Comment Utility
ok.  couple things here

1. The columns you list in your insert statement, are not matching the columns in this table

2. You have no Auto Increment to your primary key, you either need to add this AUTO_INCREMENT to the column `sellerid`

0
 

Author Comment

by:larrywish
Comment Utility
Thanks kevp75,
   I found part of the problem going back to the old ways.  I had a field in my code which wasn't in the table.  Not sure why that would throw pdo into a spin, and not sure that is still the problem.  

Thanks for all your help.  Every one was great and gave a real effort.  I think for now, I should lay the pdo thing to the side, strictly due to time constraints.  When I have some down time, I will tackle it once again.
0
 
LVL 25

Expert Comment

by:kevp75
Comment Utility
That would actually throw any code into a spin.  whether it's PHP or .Net, any time you have a query, where you are trying to either update, pull, or insert an invalid column, it will throw an error, or simply not work.

Good luck
0
 

Author Comment

by:larrywish
Comment Utility
I've requested that this question be deleted for the following reason:

I did not find the answer and decided to go a different route, therefore I solved my own problem.  Thanks for all the responses.
0
 
LVL 25

Expert Comment

by:kevp75
Comment Utility
Multiple experts here gave you the solution to this very simple problem...
0
 

Author Comment

by:larrywish
Comment Utility
Well kevp75,
   I integrated the solutions from the many experts, but none of them fixed the problem.  Therefore, how can I honestly say that any one of them gave me a solution.  I wished someone had.  But no solution was found except to abandon the pdo avenue for now and return to the regular old mysql formulas.   That was my solution, because none of the others worked.
  That's about as plain as I can put it.
0
 
LVL 25

Expert Comment

by:kevp75
Comment Utility
I found part of the problem going back to the old ways.  I had a field in my code which wasn't in the table.  Not sure why that would throw pdo into a spin, and not sure that is still the problem.  

Thanks for all your help.  Every one was great and gave a real effort.  I think for now, I should lay the pdo thing to the side, strictly due to time constraints.  When I have some down time, I will tackle it once again.

I'm sorry to say, that really isn't our problem that you gave up on this.  We've given you answers to your solutions, and it was up to you to test them out, since you gave up and did not test them out, how can you waste our time?
0
 

Author Comment

by:larrywish
Comment Utility
They were tested out and DIDN'T WORK!  How many different ways do I need to say it.  That's all there is to say and this will be the last time I waste my time with this site. You guys can do what you want with this, I'm through.
0
 
LVL 25

Expert Comment

by:kevp75
Comment Utility
They were tested out and DIDN'T WORK!

Where did you post your tests?  Where are the results of your tests?  What are your errors?

Admins...  get involved here...
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

This article will show, step by step, how to integrate R code into a R Sweave document
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now