Jump to content

lead2gold

Members
  • Posts

    164
  • Joined

  • Last visited

    Never

About lead2gold

  • Birthday 11/12/1978

Profile Information

  • Gender
    Male
  • Location
    Ottawa, On

lead2gold's Achievements

Member

Member (2/5)

0

Reputation

  1. Thanks, i solved it actually; The purpose of it is to generate statistics that certain actions took place on our system at any given hour, or for a specified number of hours. I had to iterate through the date-time they specified and dump the results into a temporar table. From there i could generate all the statistics i ever needed from the new temporary table. The statistics are used for in-house so the overhead fo the temporary table isn't a problem since only few people have access to run the generation. Thanks though for your feedback.
  2. Is it possible to retrieve hourly (or on an interval) statistics from the database? For example... assume the following table simplified to show all the fields i require info from): table a { pkey BIGINT(20); userId CHAR(4); logEntry DATETIME; } I want to be able to see how many entries there are for user 'XXXX' ever hour... for a given time range. thus... the output looking something like: intervalf | intervalt | count 2007-12-31 00:00:00 | 2007-12-31 01:00:00 | 12 2007-12-31 01:00:00 | 2007-12-31 02:00:00 | 112 2007-12-31 02:00:00 | 2007-12-31 03:00:00 | 12 2007-12-31 03:00:00 | 2007-12-31 04:00:00 | 132 ... etc is this possible? Chris p.s. Happy new year!
  3. I wouldn't deal with new lines at all. strip them out and put your text in a div tag that has a set width. let the browser do the wrapping $maxChar = 10; $string = "hello world there is a lot more text then i want here"; $trailer = "..."; $newString = ereg_replace("\n","",$string); // strip new lines $newString = ereg_replace("<.*[bB][rR].*>","",$newString); // Strip Breaks // Aquire New String to display $dispString = substr($newString,0,$maxChar); // Append "..." suffix if nessisary. if(strlen($newString)>$maxChar))$dispString .= $trailer; echo $dispString; Alternatively, you could define your $trailer to be something like $trailer='<a href="http://www... etc..">';
  4. you should pre-type your command in a file, you can then execute your statement that way. If there is a problem, you simply just edit your file. ie: $> echo "SELECT * FROM mytable;" >cmd.sql Then from your command prompt: $> sql -u <username> -p < cmd.sql but to answer your question: you are correct in thinking there is no other way to recall the last information you typed.
  5. <?php; srand((double)microtime()*1000000); $numb=rand(0,100); if ($numb>=75) echo '<img src="bigwin.png" />'; elseif ($numb<=50) echo '<img src="bigloss.png" />'; else echo '<img src="dude.png" />'; ?>
  6. Basically at the end of the day i want to do this: SELECT (row1,row2,row3) AS mergedrows FROM table Then i was hoping to interate through your typical fetch look and only have to read the 'mergedrows' id. Is it possible to concatinate multiple rows into 1? Chris
  7. Your not using your variables properly... Since the form is set up as type post, you should be accessing the $_POST variable to get your information. $seller should become => $_POST['seller'] $step should become => $_POST['step'] etc... Try flipping your variable names around first and see if your still having problems.
  8. md5(date()); is pretty unique... or just date() for that matter. if you have some session variables loaded (such as the user id, or something of that nature) you can concatinate that with the date too to make the # even more unique... md5(date().$_SESSION['userid']);
  9. Just a quick question for the gurus. I have a url with information residing on http://www.hostnamea.com I have a pointer set up in apache to redirect all traffic to from http://www.hostnameb.com to http://hostnamea.com. My problem is $_SERVER['HTTP_REFERER'] is blank in all cases when people are being redirected from hostnameb.com. Is there a way I can track (using php) all people who used the hostnameb pointer? I googled without success, and I can't seem to find an alternative variable for what i'm looking for other than $_SERVER['HTTP_REFERER'] (ref site: http://ca.php.net/reserved.variables).
  10. Thanks, i'm going to keep that link just the same. I appreciate that.  I was thinking about formating my laptop and loading up Ubuntu.  But the only thing holding me back was a web-designing tool. Not to drag this thread any longer, but is there a Flash toolkit also (for linux) ?
  11. Hi, i haven't posted here for a while... Just a quick question: Like Dreamweaver is to Windows... is there a good toolkit for a linux environment for php/html/css/(etc) development that someone can recommend?
  12. This might work too: [code] SELECT t.id,t.name FROM table t WHERE name IN (SELECT t2.name FROM table t2 GROUP BY t2.name HAVING count(*) > 1) [/code]
  13. at home i wrote 2 small functions is_pageReSubmit($uniqueID) // returns true if user pressed refresh and false, if first time loading. and PageSubmit($uniqueID); // sets a flag unique to the page that is_pageReSubmit() uses. the code would look something like this: [code] if(is_pageReSubmit($uniqueID)){   // perform insert   // if insert is success then:   PageSubmit($uniqueID); }else{   echo "Data already sent"; } [/code] The unique code i use to make a page unique is simply a hidden entry in the form. I usually use md5(date()); Make sure this value is passed somehow into $_GET (preferably $_POST). It is what you pass in as $uniqueID and voila!, a page that only runs it's data once. PageSubmit() has to add the $uniqueID to a rolling array of say... size 20. is_pageReSubmit() needs to poll the array and only return false if the $uniqueID wasn't found.
  14. that is semi dangerous code too the way you have it set up.  anyone who continues to press refresh on that page will continue to generate inserts into the database.
  15. can't you just replace all the code in the middle with this? [code] if(ereg("^http://www.mydomain.co.uk$", $row['link_back_address'])){ echo "LINK OK"; }else{ echo "BAD LINK"; } [/code]
×
×
  • 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.