Jump to content
Larry Ullman's Book Forums

Dark Prince

  • Posts

  • Joined

  • Last visited

  • Days Won


Dark Prince last won the day on January 25 2012

Dark Prince had the most liked content!

Dark Prince's Achievements


Newbie (1/14)



  1. 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.
  2. in a while loop the first query row is not shown only the ones following after , the loop is an html table
  3. well in some of my tables there is more then 1 file upload per row, but yeah it was crc32 and yeah you are right I should just check it myself to see what I get.
  4. I just found it odd looking at it in a literal way because it's checking to see if mysql has an affected row then to run it again the affected row would have already been affected, unlike mysqli_num_rows where you have to also include the query and not just the database connection
  5. 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. }
  6. 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?
  7. I just want to create a short 8 to 12 character hash code that I can use to identify certain rows in a table instead of using an id number, and also to be used in a security check.
  8. 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
  9. 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
  10. tried that too i even put UPDATE tablename WHERE column=value SET , instead of the WHERE at the end of the query I even tried adding the IGNORE as well.
  11. 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.
  12. 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
  13. there are so many generators for hash codes whats the best one to generate low character hashes around 6 to 12 characters?
  • Create New...