Jump to content

PHP and MySQLi


Go to solution Solved by Ch0cu3r,

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.