Jump to content

RussellReal

Members
  • Posts

    1,773
  • Joined

  • Last visited

Everything posted by RussellReal

  1. oh yeah =\.. 0 would be from the start 1 would be after the first, sorry bro premiso is right
  2. wow, or that, mysql is intense =o
  3. because $row['table_primary'] is not the same as $table_primary lol
  4. substr($dir,1) should fetch the whole string except the first 2 characters, note: indexs start at 0
  5. well.. lets break that down; 1) Your script will ONLY be affecting the rows which are older than 10 minutes, if I'm right continue onto step 2.. 2) in order to select rows older than 10 minutes, what would be a good query, -->a) (IF UNIX TIMESTAMP) "SELECT * FROM `table` WHERE `theTimestamp` < '".(time() - (60 * 10))."'" -->b) (IF DATETIME FIELDTYPE) "SELECT * FROM `table` WHERE `theTimestamp` < DATE_SUB(NOW(),INTERVAL 10 MINUTE b) 3) grab the results $qry = mysql_query($sql); while ($r = mysql_fetch_assoc($qry)) { $results[] = $r; } // see step 4 4) do the math on each result, possibly in a foreach for the array $results, gather the ids and the time difference, then do the changes in another query
  6. ^^ yeah basically what I said, but probably more understandable lol
  7. basically escaping the data is to get it successfully to the database if inside your string somewhere you have a ' it will kill the query thats why it turns ' into \', but when it reaches the database it will have been escaped in the query, therefore it will show up correct in the database, you most likely as wolf states gave magic quotes on, so, you'd want to stripslahes
  8. while($assoc = mysql_fetch_assoc($q)){ $test = $assoc; if($assoc['floor_area_num'] != "" && $assoc['AskingPrice'] != ""){ $test['PricePerSqFt'] =intval(0.5+$assoc['AskingPrice']/$assoc['floor_area_num']); } }
  9. if (file_exists('$file')) { is where your problem is ' single quotes do not evaluate variables, use double quotes or no quotes at all.. you don't need to quote variables. if (file_exists($file)){
  10. storing it in a file?
  11. $conn = db_connect(); $result = $conn->query("SELECT * FROM notice_board"); $result2 = $conn->query("SELECT COUNT(*) FROM notice_board"); while($row = $result->fetchObject()) { $column = $result2->fetchColumn(); echo '<tr>'; echo '<td>'.$row->id.'</td><td>'.$row->type.'</td><td>'.$row->entry.'</td><td>'.$row->sl.'</td><td>'.$row->tp.'</td><td>'.$row->notes.'</td><td>'.$row->changes.'</td>'; echo '</tr>'; } $conn = NULL;
  12. anytime bro, click 'solved' so nobody else here comes and checks dis post out or w\e, so u can save us helpers a lil more time, nah mean. Ty
  13. ok.. <?php $q1 = mysql_query("SELECT * FROM `tbl1`"); $q2 = mysql_query("SELECT * FROM `tbl2`"); while ($tbl1 = mysql_fetch_assoc($q1)) { $t1[] = $tbl1; } while ($tbl2 = mysql_fetch_assoc($q1)) { $t2[] = $tbl2; } $lead = ((count($tbl1) <= count($tbl2))? $tbl1:$tbl2); $foll = ((count($tbl1) >= count($tbl2))? $tbl1:$tbl2); for ($i = 0; $i < count($lead); $i++) { for ($k = 0; $k < count($foll); $k++) { if ($lead[$i]['cnt'] > $foll[$i]['cnt']) { do something } } } ?>
  14. or, you could store the php code, in a temporary file.. example: <?php $d = mysql_fetch_assoc(mysql_query("SELECT `phpdata` FROM `theTable` WHERE `girls` = 'sexy`")); $newphp = fopen('temp.php','w'); fwrite($newphp,$d['phpdata']); fclose($newphp); ob_start(); include('temp.php'); $evaluatedPHP = ob_get_flush(); unlink('temp.php'); ?> however, eval would be much better lol
  15. exactly, so if they get the captcha wrong, you generate a NEW captcha image.. I created a captcha image generated a while ago, and I'm not exactly sure how great it is anymore, but its works good.. I've attached it to this post and heres a link to a demo: Image Plain Text from Image [attachment deleted by admin]
  16. SELECT * FROM `tbl1` JOIN `tbl2` ON (tbl1.cnt > tbl2.cnt) WHERE `whatever` = 'whatever' basically this query will grab every row TO BEGIN WITH which tbl1.cnt is greater than tbl2.cnt then, it will proceed with the WHERE clause on that result set.
  17. sort by id and and do LIMIT 1,1 LIMIT 2,1 LIMIT 3,1 the mysql query would look similar to: SELECT `image_blob` FROM `image_table` ORDER BY `image_id` ASC LIMIT 1,1
  18. considering the downtime, you should update the session you're using but this is not a good method to do whatever you're doing, its inefficient..
  19. some attempted code would be nice.. lol, not to be rude, but if you're looking for people to write a script for you, there is a freelance forum where people do exactly that.. but here we help with errors and problems.
  20. we can't give you directions as to how to echo the data, considering we do not know how flash expects to receive the data.. E.G. XML, CSV.
  21. dreamweaver although IDEs aren't really meant to code it for you, its mostly for code hinting and highlighting, but dreamweaver is the primary choice of lazy developers.
  22. ok, you don't want to echo all the data to the page for JavaScript to access it, UNTIL the button is pressed I'm assuming? Well, PHP is a server side processor, so basically, once JavaScript is started, PHP is already closed, and all the variables/resources/etc are destroyed and inaccessible.. What you could do, is set up some AJAX and everytime the button is pressed, connect to another php page, which it will still be within the same browser so the session will still be active.. just echo the data of the session into that php and then AJAX will retrieve it and you can play with it all you want once AJAX has it.
  23. ahaha thats what I was gonna say!!!
  24. try this query mysql_query("SELECT * FROM `forumtutorial_posts` WHERE `parentid` = '0' LIMIT ".(($page - 1) * $tolimit).",4");
  25. dude, usually php will shut down after a while.. lol unless you set the timeout to 0
×
×
  • 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.