ryantroop 177 Practically a Master Poster

Primary refers to it being a primary key, which means it is the first column checked against when relating to other tables, when running joined queries.

Default is the default value given, assuming that no data is passed to it when a row is created.

Please keep in mind that you should be hashing your passwords when they are stored in a database. They should be hashed in PHP, then stored as a varchar(8/16/32) depending on the hash type you use.

Passwords are not meant to be saved as plain text in a database. Imagine getting hacked, and all your users will have their passwords exposed. Always try to make it one step harder if you can.

However, before you even get there, we need to get you a working page.

ryantroop 177 Practically a Master Poster

You would do well to understand what SESSIONS are COOKIES are, and how to use them. Basically, as you are using them, a permission file is a php page that can be accessed when the user is logged in, and their session data is available to the server.

Sessions are pretty simple.

To start them, you simply add:
session_start(); to the top of any page where a user will need to have persistent data available to the page.

As for logins, you can do a form/whatever flavor of validation you want, and then after you call session_start(); you can populate sessions as you would any array.

session_start()
$_SESSION['user'] = "LastMitch";

Now, any time that a user accesses a page on my server, from my http root, as long as there is a session_start() as the first line (some rules are meant to be broken) of PHP code on the page (preferrably before any code, even HTML), I can access my global (that's what $_ is for) variable $_SESSION[].

To destroy, or end a session, you can either close your browser and it should end automatically. Or, you can manually do it by unsetting/destroying the session.

if($_GET['end_session'] == "True") {
session_unset(); //remove all session data, but leave persistence
unset($_SESSION['user']); //alternatively we can unset a specific variable in the array.
session_destroy(); //in either case, we want to remove persistence, and end the session completely.
}

In the particular snippet above, it is saying:

    if(!$_SESSION[""]) {      //if no session …
LastMitch commented: Thanks for the link & the simple example & explanation! +0
ryantroop 177 Practically a Master Poster

I still think you are using $_POST a bit...awkwardly...

I also think youre using MySQL very ineffeciently... you can make combined queries, I feel, for much of what you are doing.

However, line 28 is the only query that matches your error. On line 27 and 28, your comma is being placed improperly, I think... to double check, change line 31 to:

mysql_query($sql2a) or die("THIS IS MY ERROR!");

If you get that message, then you need to change your iteration, and make it happen one step earlier.

Ryan

ryantroop 177 Practically a Master Poster

I know it sounds silly.. but it's happened to me before that I didn't put a semi-colon at the end of my sql query, and it failed since SQL was waiting for a new command...

Try:

$queryget = mysql_query("SELECT * FROM image WHERE user_id = '$user_id_s';");

If that doesnt work, change it to

  $queryget = mysql_query("SELECT * FROM image WHERE user_id = '$user_id_s';") or die (mysql_error());

and see where it is failing.