I have a little SQL Commands Here
Databasename:Numbers
select * from tblstart where id = 1
output = 10
select * from tblstart where id = 2
output = 20
select * from tblstart where id = 3
output = 30
select * from tblstart where id = 4
output = 40
select * from tblstart where id = 5
output = 50
How can i transfer this output in textbox during Page Load
<input type="text" name="OutputOf10"><br>
<input type="text" name="OutputOf20"><br>
<input type="text" name="OutputOf30"><br>
<input type="text" name="OutputOf40"><br>
<input type="text" name="OutputOf50"><br>
Any help would be appreciated TY
Here is the code so far but im getting errors
Here is the php code(Updated)
<?php
$host = 'localhost';
$db_user = 'root';
$db_pass = '';
$db_name = 'poi';
try {
$pdo = new PDO('mysql:host='.$host.';dbname='.$db_name.'', $db_user, $db_pass);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$stmt = $pdo->prepare('SELECT COUNT(name) FROM tblmarker WHERE name = (Robbery)');
$stmt->execute(array('id'));
$result = $stmt->fetchAll();
if ( count($result) ) {
foreach($result as $row) {
$OutputOf10 = $row['Name'];
echo '<input type="text" name="OutputOf10" value="'.$OutputOf10.'"><br>';
}
} else {
echo "No rows returned.";
}
} catch(PDOException $e) {
echo 'ERROR: ' . $e->getMessage();
}
?>