How do I do this procedure using PDO?

Here's what I have currently:

$michelle="SELECT * FROM `gant` WHERE submitted_date<'$week_one_code' and target_UAT_date>'$week_one_code'";
		$michelle_query=mysqli_query($mysqli, $michelle);
		$donald="delete from gant_rows";
		$donald_query=mysqli_query($mysqli, $donald);
		//we don't need to display when the project was initally assigned, but we do need to know how many days it extends into the displayed 12 week timeframe
			$UAT_date_initial_obj = strtotime($michelle_row['target_UAT_date']);
			$UAT_initial_secs=$UAT_date_initial_obj - $week_one;
			$the_number_of_initial_cells = number_format(($UAT_initial_secs / 86400), 0);

Open in new window

I want to accomplish the same thing using PDO. Thus far I've got:

$sql_23="select * from net_BudgetTools..tbl_DEVELOPERS_Projects where dte_DateStarted <'2015-08-16' and dte_RequestorDueDate> '2015-08-16'";

	//right here, I want to be able to pull data out using the PDO equivalent to extract($michelle_row) and then be able to reference specific data like before as far as $michelle_row['dte_DateStarted'] etc. How?

Open in new window

Bottom line: Right after "while($row_23=$mssql_stmt_23->fetch(PDO::FETCH_ASSOC))" I'm clueless. I've done the "foreach" thing previously, but I want to go with the "while" loop and then be able to extract things from there.

Bruce GustPHP DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Julian HansenCommented:
I am confused about a few things when you say you want to use the "equivalent" of extract.

Firstly, there is none - extract exists outside of mysqli / PDO - it is a PHP function for pulling values from an array into the current scope (

In your mysqli implementation your line

Open in new window

is wasted because you never use the result of the extract.
Look at the code extract
  // THE $michelle_row
  $UAT_date_initial_obj = strtotime($michelle_row['target_UAT_date']);
  $UAT_initial_secs=$UAT_date_initial_obj - $week_one;
  $the_number_of_initial_cells = number_format(($UAT_initial_secs / 86400), 0);

Open in new window

Instead of
  $UAT_date_initial_obj = strtotime($target_UAT_date);
  $UAT_initial_secs=$UAT_date_initial_obj - $week_one;
  $the_number_of_initial_cells = number_format(($UAT_initial_secs / 86400), 0);

Open in new window

There is no reason why you cannot use extract() within the while loop for your PDO statement.

I am not sure if I have understood the requirement?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Bruce GustPHP DeveloperAuthor Commented:

As always, thanks for taking the time to weigh in.

Using your input, I was able to go in and make some changes and I'm good to go now.

Julian HansenCommented:
You are most welcome Bruce,
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.