Jump to content

PHP and MySQLi


magcr23

Recommended Posts

I tried to do something like that:

 

$row=mysqli_fetch_array($resultado,MYSQLI_ASSOC);

$user = $row['user'];

echo $user;

 

But the result is the same.

Can you tell me what am i doing wrong? Or modify my code to do what i need? 

I need this problem solved to continue with my project, or i'll fail in my class xD

Link to comment
https://forums.phpfreaks.com/topic/296843-php-and-mysqli/#findComment-1514039
Share on other sites

I think that half of the problem is solved, with that i can see the right user who's logged.

 



$row=mysqli_fetch_array($resultado,MYSQLI_ASSOC);
$user2 = $_SESSION["user"];
echo $user2;


 

But how can i update an password?

 

I tryed with that:

 



$updatePW= "UPDATE admin SET password = sha1('$new') WHERE user = password = sha1('$old') ";


 

But it update all the equal passwords. So i tryed with that:

 



$updatePW= "UPDATE admin SET password = sha1('$new') WHERE user = $user2 && password = sha1('$old') ";


 

But it don't work... What can i do?
Link to comment
https://forums.phpfreaks.com/topic/296843-php-and-mysqli/#findComment-1514049
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.