Select mysql data according to ID from URL address
Discuss coding issues, and scripts related to PHP and MySQL.
-
JanMolendijk
- Posts: 268
- Location: Holland Rotterdam
Select mysql data according to ID from URL address
I need your help again i cant find out how to select a specific id to show
i have this address:
jan-molendijk.16mb.com/Notice/user/index.php?page=memberslist
Their standing two names when i click on one name it does not show the data from the selected name
On this page i have this code:
Code: Select all
echo '<br /> <a href="http://jan-molendijk.16mb.com/Notice/user/index.php?page=users&id='. $row['id']. '" title="" class="postlink" target="_self"> '. $row['name']. ' '. $row['gender']. ' '. $row['dob']. '</a> ' ;
But it select only the same name when i click on someone name because i use the wrong code like this:
Code: Select all
<?php
session_start();
include('../connection.php');
$user= $_SESSION['user'];
$sql=mysqli_query($conn,"select * from user where email='$user' ");
$users=mysqli_fetch_assoc($sql);
?>
<?php echo $users['name'];?>
I hope my English is understanble
JanMolendijk
After day working i finaly found it out.
i added this code:
Code: Select all
$id = (int) $_GET['id'];
$sql = $conn->query("select * from user where id=$id");
Similar Topics
-
Get hash # from URL address
PHP - MySQL
First post
Plessant Coursesweb
I have in this url standing an hash
//145.53.93.209/Molendijk/home/read.php?id=<?php echo $row ?>#<?php echo $row...
Last post
To get the hash from current url address in javascript, use the hash propertty
<script>
//set the hash
window.location.hash ='hsh';
//get...
-
Add results from database in form address
PHP - MySQL
First post
Hello Coursesweb
I have a problem to get results from the database into input type text form in the place name.
name= id='. $row1 ....
Last post
Marplo thanks thanks thanks for all suport
& even so quick suport `thanks again`
it is working
I could kiss you :D
-
Data from SQL in alphabetical order
PHP - MySQL
First post
Plessant Coursesweb,
I have an grouplist in my database from country`s.
First time I did not do any search-study for this questionm but ask you...
Last post
@HayatAnsiklopedisi , post the SQL query you have, and explain what result you want to get.
-
SSEP - BUT Cannot save its Page Data
Scripts from this website
First post
Every time I try to index the site it comes back with this message for some of the pages:
BUT Cannot save its Page Data
It indexed 323 pages but...
Last post
nice, and nice script, you know what your doing
If you ever want to write a post, article or blog...
Maybe on PHP Resources ?
Id be glad to add it...
-
Delete Data without Refreshing Page
JavaScript - jQuery - Ajax
First post
Happy New Year Chief.... My first two weeks I spended on bed due to illness
I wanna use a script but it does not delete the item from my sql...
Last post
O God that I did not see this `stupido me`....
Thank you very much for all the support `its working now`