CompleteNewbie
-
Posts
3 -
Joined
-
Last visited
Posts posted by CompleteNewbie
-
-
i just found the problem 😅
while checking your proposition i realised i wrote $rows with an 's'...
Now it works
-
I'm trying to recreate the code from PHP, mysql, javascript, CSS and HTML from O'reily, but i can't make it work
Here's the code I added:
$query = "select * from classics";
$result = $connection->query($query);
if (!$result) die ("Database access failed: " . $connection->error);
$rows = $result->num_rows;
for ($j=0; $j < $rows; ++$j)
{
$result->data_seek($j);
$row = $result->fetch_array(MYSQLI_NUM);
echo <<<_END
<pre>
Author $rows[0]
Title $rows[1]
Category $rows[2]
Year $rows[3]
ISBN $rows[4]
</pre>
_END;
}
Here's the error i receive:
Notice: Trying to access array offset on value of type int in /var/www/html/test/mysqlitest.php on line 53
I didn't put all the code because everything else works well, i can connect to mysql and add stuff, but i can retrieve stuff using fetch_array['author'] but fetch_array(MYSQLI_NUM) doesn't work.
I've tried things from the web but I've only been doing php for a week so my knowledge is quite limited.
Thank you for your time.
problem with ending a session
in PHP Coding Help
Posted
Hello,
I have the $_session code working, but after I destroy the session and I am asked to log in again, my browser doesn't ask me for my password and just logs me in.
I don't understand because I have destroyed my session and I have deleted the data in $_SESSION and I have deleted the info in the cookie so it shouldn't log me in automatically. I thought it was something in my browser, but I erased my history and I never saved any password.
Here's my code:
This is the welcome page
and this is the other page:
When I type the website in i first get prompt to enter my password, when I am authenticated the webpage says: You are now logged in click here to continue. When I do I am directed to another page which confirms that I am still logged in. Then I press refresh and the webpage asks me to "Click here to log in". I do, but it doesn't ask me for my password again. Why? My personal info should be destroyed.
Thank you for responding. It's greatly appreciated