Dark Prince
Members-
Posts
62 -
Joined
-
Last visited
-
Days Won
2
Dark Prince last won the day on January 25 2012
Dark Prince had the most liked content!
Dark Prince's Achievements
Newbie (1/14)
5
Reputation
-
Yes and Yes you did understand right while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { $bg = ($bg=='#eeeeee' ? '#ffffff' : '#eeeeee'); echo '<tr bgcolor="' . $bg . '"> I ran the query manually in mysql and it shows the first results, but when viewed in a browser in html table format the first result is not returned only the ones following after.
-
with the mysqli_affected_rows() function can it be run more then once in a script that has more then 1 update or insert query? like eg. I have an update query in a script and after the query is run I use if (mysqli_affected_rows($dbc) == 1) { // if this table is updated only then update the other table. $query2 = "UPDATE etc. etc." $result2 = mysqli_query($dbc, $query2); // Can I use mysqli_affected_rows() again here? } else { // First update did not work. // echo error statement here. }
-
I'm not sure I want to use it for identify rows in a table yet but it would be nice to be able to add a 8 character hash to some fields like file uploads having a hash before the file name will reduce the likeliness of a file being overwritten by 99.999%, does cr32 create an 8 character hash or does it need to be truncated?
-
you want to give attackers a hard time add 2 fields to your user table make one a char or varchar of 32 for md5 and a timestamp then when they login do an update query that adds the server time and an md5 hash then create a function in the page that checks the sessions md5 and timestamp against what was in the database that way even if they can guess the session name they can't guess the time the user logged in and a 32 xharacter hash
-
yeah it was the quotes but also the TABLE part after UPDATE would still stall the query, and the ones without values are NULL set by the php code if the field is empty. I thought it was missing quotes but I didn't give it thought because of your first example and thought something else was messing it up like maybe I got a column wrong and put an alpha numeric value in a numeric only field. but everything is working now thanks alot guys for your patience
-
phpmyadmin gives error 1064 I don't get it all the information being updated was just entered into an insert query with the other 2 columns not used in the update query the datetime and a counter field and it works just fine, but when its run in an update query it keeps stopping at the sql syntax error.
-
those aren't the actual name of the column's I edited them to keep it down to just the code itself without given names and variables. so here is an edited version of the query being run. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TABLE tablename SET column2=random field, column3=1, column4=87517, column5=1, column6=sell, ' at line 1 Query: UPDATE TABLE tablename SET column2=random field, column3=1, column4=87517, column5=1, column6=sell, column7=big description field is boring to fill out., column8=key field who cares, column9=nother key field jeeze, column10=random unneeded field, column11=boring blah blah, column12=, column13=, column14=, column15=, column16=, column17= WHERE column1=14