Jump to content

PC Nerd

Members
  • Posts

    1,122
  • Joined

  • Last visited

    Never

Everything posted by PC Nerd

  1. well instead of using the sessiocn as your cart, id write all the items into a database. like id have an item number, a user id, and a cart id. then a date or something, then the item name this way you can veiw a particular cart simply by calling its id...... maybe store the id in a session or something. that way you can always come back to the cart if theres an error or something, or dispute etc. good luck, if you want me to expand, please pm me
  2. ok, im a little confused..... there are three seperate forms, and each one sets a new row in a database? if so, then simply write a foreach through the forms ( or sm=omething ) and write your data to the database. or simply manually write each line into the file.... if its dynamic with javascript, and you want to know if a value is set? then you just do if(isset($Vaule)) {then do stuff} if none of those, please post back good luck
  3. $Max_Points = 30; #$Page_Data['Points'] * 1.2; $Min_Points = 1; #$Page_Data['Points'] * 0.5; $Def_Start_SQL = "SELECT User_ID, Points FROM General_Stats WHERE Points > '".$Min_Points."' AND Points < '".$Max_Points."'"; $Def_Start_Query = mysqli_query($DB_Server, $Def_Start_SQL) or die("Could not retrieve Defenese Players."); thankx
  4. hi guys while($Def_Start = mysqli_fetch_array($Def_Start_Query, MYSQLI_ASSOC)) { $Def_Options[] = $Def_Start['User_ID']; } this is looping endlessly, untill it reachs the index of $Def_Options[9999] whats wrong, there are only 21 records in the database? thankx in advance
  5. im, i dont really understand your question. do you mean that the page name pasted in the etxt field, that that page is the content mailed. or that the content placed in the text field is sent to a page as an email??? tha later is not posible. the first is if the page is on the same server etc. please post back and expand
  6. ok, this is really rough, but you can look up the functions i use so that their relevent to your version of mysql etc. $sql = "SELECT col1, col2, col3 FROM table1 WHERE coll1 = '".$Value_to_test."'"; $query = mysqli_query($Connection, $sql) or die("could not run query"); $result = mysqli_fetch_array($query); ### do stuf with data. read up on the mysql_***** functions. i wont run through a full tutorial here, but google it. if you know a but about php, or even programming in general, then it should be reasonably easy to understand. good luck
  7. hi guys im createing a new login system, before i was simply using cookies what i want to do is log every login, length and time in the database. so i want to create a new record, with a unique login id, and link it with the user id. then i want to know that particulay login id, to save in the cookie, so that when you logout, it retrives the login record, and updates the logout. what im looking for is a way to retrive the login id from the database, but the login is an auto increment, so its always unique. how would i retrive that particular record, without having to assing a unique value for the record from the php script. thanks for your help in advance, PC Nerd
  8. ill make a new thread abut the timestamp storage, thankx anyway
  9. thankx do you have any help with the login timestamp or is that another thread?
  10. does anyone have any idea to what to look for, or how to organise this??????
  11. well if its auto increment, you could either go through two queries, one to find the number of records on the database, and chose the highest number at the recods id which is how id do it, or you could get al the records, and loop throught ehem using while, then that last one would have been the one that you want good luck
  12. soz guys, the arrays indexes were interpreted as tags, ill re send it
  13. if i have a n array like this: $Arr['a']['x'] = ''; $Arr['a']['y'] = ''; $Arr['a']['z'] = ''; $Arr['b']['x'] = ''; $Arr['b']['y'] = ''; $Arr['b']['z'] = ''; $Arr['c']['x'] = ''; $Arr['c']['y'] = ''; $Arr['c']['z'] = ''; and i want to find the actuall value not type of the first index, how do i get it ie, if i was simply to foreach throughit then echo it, id get Array, instead of "a", or "b", or "c"
  14. im, i dont know, but i know that you can use the function in my other thread http://www.phpfreaks.com/forums/index.php/topic,134786.0.html. tjhis only works on the same page i think..... good luck
  15. thankx giuys, shuffle worked!!! YAY thankx again
  16. hi im not sure whether or not its not working, but im giving the function an array thats 12 elements long, but whats happening is it seems to simply be taking a random number from the length of the array, not selecting a random element from the array..... do you know whats happening???
  17. ok, ive done that when it comes to echoing the database link stuff, it says that mysqli_object cannot be converted to string, so how do i catch that error and replase it with the string eg "MYSQL OBJECT" this is what i have: $page_variables = get_defined_vars(); foreach($page_variables as $field1 => $value1) { if(is_array($array1)) { foreach($field1 as $field2 => $value2) { echo $field2." => ".$value2."<br>"; } } else{ echo $field1." => ".$value1."<br>"; } } i only have variables and arrays, from memory no multidimentional arrays....... but i know that ive got for example a loop that loops througha mysql result, and there are many records int he result, so i used the while(var = mysqli_fetch_array) so how do i get those values ( if i cant thats ok) thankx
×
×
  • 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.