+ 2
Phpmyadmin and database
I am making a localhost server and I have completed login and registeration part now I want that after successful login on another page it show/get the username of current user stored in localhost database . Please help.. Thanks in advance.
8 Respostas
+ 1
🅰🅺🆂🅷🅰🆈,
Currently i am personally using the following:
(so it should work like all the previous codes, if you had take a look at the link i provided you get more knowledge then just looking at the code)
rows:id, clicks, like, dislike
$aVar = mysqli_connect("data to connect");
$like2chainz = mysqli_fetch_assoc(mysqli_query($aVar, "SELECT * FROM likes WHERE id='1'"));
$dislike2chainz = mysqli_fetch_assoc(mysqli_query($aVar, "SELECT * FROM likes WHERE id='2'"));
$dislike2chainz[clicks]
$like2chainz[clicks]
+ 1
🌴Vincent Berger🌴
not working
+ 1
🌴Vincent Berger🌴 can you send a example
0
Hi 🅰🅺🆂🅷🅰🆈,
SELECT columnnames FROM tablename
Or select all from table:
SELECT * FROM tablename
E.G.:
$callBack = "SELECT id, username FROM Users";
$display = mysql_fetch_assoc($callBack);
<?php
echo $display[user];
?>
Additional:
https://www.w3schools.com/php/php_mysql_select.asp
0
🌴Vincent Berger🌴 not working.
See,
Like my database has id, username, email and password columns.
User login with email and password. and i want that after the login of particular user it shows the username of that particular logged in user.
0
$callBack = "SELECT id, username FROM Users WHERE id='1';
<?php
echo $callBack[user];
?>
WHERE id is assiocated with your specific username,
0
🅰🅺🆂🅷🅰🆈, this should work.
$aVar = mysqli_connect(your data to connent to mqsql);
$call = mysqli_fetch_assoc(mysqli_query($aVar, "SELECT * FROM users WHERE id='1'"));
echo $call[username row title];
0
کس ننت