Hi Eric,
I have couple of questions for you.
The first question is pdo_connect.php will be a separate php file?
The second question is where do I put the second half of the code?
The page is HTML code Will be able to do this
AL
<?php
$state = $_POST['state'];
include('pdo_connect.php');
try{
$query2 = $pdo->prepare("SELECT * FROM mytable_name WHERE state = :state");
$data2 = array(
':state' => $state
);
$query2->execute($data2);
foreach ($query2->fetchAll(PDO::FETCH_ASSOC) as $row) {
$breeders_name = $row['breeders_name'];
$othercolumn = $row['othercolumn'];
}
}
catch(PDOException $e){
}
echo $breeders_name;
?>
AK
<?php
$state = $_POST['state'];
include('pdo_connect.php');
try{
$query2 = $pdo->prepare("SELECT * FROM mytable_name WHERE state = :state");
$data2 = array(
':state' => $state
);
$query2->execute($data2);
foreach ($query2->fetchAll(PDO::FETCH_ASSOC) as $row) {
$breeders_name = $row['breeders_name'];
$othercolumn = $row['othercolumn'];
}
}
catch(PDOException $e){
}
echo $breeders_name;
?>
So on
Do I have to replace anything in the second half of the code. It looks like to replace line from this
{
$query2 = $pdo->prepare("SELECT * FROM mytable_name WHERE state = :state");
to this
{
$query2 = $pdo->prepare("SELECT * FROM breeder_directory WHERE state = :state");
Thanks for the help