value row in php dropdown

Ukończone Opublikowano 4 lat temu Płatność przy odbiorze
Ukończone Płatność przy odbiorze

I need my dropdown remeber the last selected when i go back to editpage

<?php

//Connect to our MySQL database using the PDO extension.

$pdo = new PDO('mysql:host=localhost;dbname=test', 'root', '******');

//Our select statement. This will retrieve the data that we want.

$sql = "SELECT id, username FROM users";

//Prepare the select statement.

$stmt = $pdo->prepare($sql);

//Execute the statement.

$stmt->execute();

//Retrieve the rows using fetchAll.

$users = $stmt->fetchAll();

?>

<label for="title">Team:</label>

<select id="title" name="username" style=" width: 100%; padding: 7px; margin: 8px 0; box-sizing: border-box; >

<?php foreach($users as $user): ?>

<option value="<?= $user['username']; ?>"><?= $user['username']; ?></option>

<?php endforeach; ?>

</select>

PHP MySQL SQL Architektura oprogramowania XML

Numer ID Projektu: #25433417

O projekcie

10 ofert Zdalny projekt Aktywny 4 lat temu

Przyznany użytkownikowi:

joshiprakash

Hi there, I am an expert at the PHP & surely can help you on this, Also available to start on work right away let me know if you can send me the code or FTP thanks.

$14 USD w 1 dzień
(112 ocen)
6.0

10 freelancerów złożyło ofertę za $22 w tym projekcie

vyasrohan

Hello There, I am having huge experience in PHP. I will fix your issue. I can start right away and complete it in next 1-2 hours. Looking forward for quick and positive reply. Thanks Rohan Vyas

$20 USD w ciągu 1 dnia
(293 Oceny)
7.9
wontonesaju

Hi During the addition time you can save its value and then edit you retreive the value / compare with condition. i am placing my quote for this job. regards saju

$15 USD w ciągu 7 dni
(203 Oceny)
6.7
vismat

Hey, why I'm interested in this fantastic project because I am Full stack developer and designer, with over 6 years experience dealing with Wordpress, I can help build your website. I've previously worked on the exact Więcej

$50 USD w ciągu 1 dnia
(91 Oceny)
6.3
caciocode

Hi, I am a PHP developer. I can make changes and fix issues in your PHP script. I can get the script to display the selected value when you visit the page again.

$10 USD w ciągu 1 dnia
(192 Oceny)
6.3
testotorko

Hey. I want to do this project. Some of my skills are: PHP, MySQl, jQuery / Prototype, Javascript, HTML, CSS. Can start right away.

$27 USD w ciągu 1 dnia
(102 Oceny)
5.7
Fespinosa17

Hi. It is easy. Please use SESSION. I hope my proposal will be helpful for you. Regards, Fabian.

$30 USD w ciągu 1 dnia
(43 Oceny)
5.2
hassannazeer

Hi, I can create php that remember the last selection of drop down in above code. Let do it now Thanks.

$18 USD w ciągu 1 dnia
(9 Oceny)
3.0