Completed

PHP PDO select from passed variable

I am passing variable to the next page with

<a href="[url removed, login to view]<?php echo $my_number; ?>">

on the next page I want to display the contents of the mysql database and am trying to do so with something like this and having no luck.

<?php

try {

$handler = new PDO('mysql:host=localhost;dbname=db', '', '');

$handler->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

} catch(PDOException $e) {

echo $e->getMessage();

die();

}

$query = $handler->query("SELECT * FROM my_table WHERE my_number = :my_number ");

$stmt = $handler->prepare($query);

$stmt->bindParam(':my_number', PDO::PARAM_STR);

$stmt->execute();

$results = $stmt->fetch();

($result as $row){

}

Then I am trying to display the my_table fields with on my page with:

This is field one <?php echo $my_field1; ?>

This is field two<?php echo $my_field2; ?>

This is field three<?php echo $my_field3; ?>

I do know know what my problem to day is but just some help to finish,

Will pay as soon as script is working. Needed NOW>>>>

Skills: MySQL, PHP

See more: the catch of the day, select, php pdo, pdo, php script execute, php warning variable passed array object, fetch mysql, php localhost, mysql fetch, mysql variable help, variable mysql, pdoexception, fetch results, php mysql database query, php script echo, help contents mysql, echo script php, pdo mysql, php echo script, catch day

About the Employer:
( 43 reviews ) Port Charlotte, United States

Project ID: #6704962

Awarded to:

crivionUK

i can quickly help you out sort this and explain you what you are doing wrong i can quickly help you out sort this and explain you what you are doing wrong i can quickly help you out sort this and explain you what you More

$10 USD in 1 day
(1 Review)
2.8

8 freelancers are bidding on average $23 for this job

sprextech

----------------------------------------------------------Please Consider on My BID---------------------------------------------------Dear Sir/Madam, We are already read your project description & fully understand this More

$31 USD in 1 day
(83 Reviews)
5.9
ForeignTree

I am here to support and help for fixes within very less time. I would like to help you in passing the values to other form.

$30 USD in 1 day
(9 Reviews)
5.0
techagelab

Dear Client, I am Jas, Head - Head - Web Development and Digital Search Marketing Team at TechAge Labs Pvt. Ltd. - www.psdtohtml5express.com. I have read and understood the requirement and can do this project in no More

$24 USD in 1 day
(6 Reviews)
3.4
dapu92

Hello can i try to fix it, i will not ask you to award me the project unless script is fixed. Regards, Darpan

$26 USD in 0 days
(7 Reviews)
3.2
ratulcse10

Hello I can solve the problem and make working you code NOW !! Waiting for your response to talk and start Thanks

$30 USD in 1 day
(9 Reviews)
3.1
Prakhar01

Hi, I am a full-time freelance developer with special interests in creating scripts for process automation. I have worked extensively on csv/ txt/ xml/ excel data manipulation, pdf generation, emails, PHP forms etc. More

$15 USD in 2 days
(1 Review)
3.0
madza91

A proposal has not yet been provided

$25 USD in 1 day
(0 Reviews)
0.0
orihamama

A proposal has not yet been provided

$20 USD in 0 days
(0 Reviews)
0.0