Jump to content

switchdoc

Members
  • Posts

    22
  • Joined

  • Last visited

    Never

Contact Methods

  • AIM
    switchdoc00
  • Yahoo
    switchdoc02

Profile Information

  • Gender
    Male
  • Location
    Colorado

switchdoc's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Two things I can think of 1) echo out $del_id so you know its getting set correctly. 2) (and I may be wrong about this) can the action for your form really be "" ? -Switch
  2. A better example is found in the query: $lw1_query = mysql_query($lw1_sql) OR DIE ("There was an error" .mysql_error()); ("There was an error" .mysql_error()); Is basically saying if there is an error to output: "There was an error" + whatever mysql_error()) reports as the error. So you would get "There was an error unspecified field 'monkey' in table 'zoo'" or whatever -Switch
  3. Its kinda like a way to write this + this + this to allow you to move in and out of the quotes. In that case you are basically saying: echo '<option value="'.$player_id.'"> plus '.$player.' (the variable not the actual words $player) plus </option>\n'; The '.'s link it together. Matt may be able to explain it better but thats the basic jist anyway. -Switch
  4. Hey all, Thanks for all the replies! The answer just came via an email to a buddy I'd sent out earlier. Here is what he ended up having me do so I could get the hit count and use the page name (from another table) rather than just ID: [code] $query = "select count(t1.linkid),t2.pagename from page_counter as t1 inner join pages as t2 on t2.linkid=t1.linkid where t1.clickdate>='$sd' and t1.clickdate<='$ed' group by t1.linkid"; $result = mysql_query($query) OR DIE ("there was an error" .mysql_error()); while ($line = mysql_fetch_array($result,MYSQL_NUM)){list($count,$name) = $line; [/code] Then I can echo out the page name ($name) and the hits($count) into a table using the while loop. Thanks again for all your replies! -Switch
  5. Well, I just went back and looked and I think I screwed you all up. The scoop is I need ALL hits for each link in a date range So if the user selects 11/3 - 11/21 Each time the link appears in that date range, I need to count it so I can say LinkID 111 Hits 3 LinkID 237 Hits 56 Sorry for the confusion. -Switch 
  6. Thanks for the fast replies! I don't suppose anyone can show me how to pull this out on the other end, I am not quite sure how to echo out the clickdate (sum). Appologies in advanced and thanks! -Switch
  7. Hello,   Assuming you are using MySQL, this is how I do this: (I am taking while guesses that you have player names and auto-incremented player IDs. If you don't, you might want to consider it. ) [code] <select name='players'> <?php $query = "SELECT * from players"; $result = mysql_query($query) OR DIE ("There was an error .mysql_error()); while ($line = mysql_fetch_array($result,MYSQL_ASSOC)){ $playerid = $line["playerid"]; $player = $line["player"]; echo "<option value='$playerid'>$player</option>\n"; } ?> </select> [/code] The first part queries all the players out of the database. The second part assigns the variables in the array to straight variable names which are easier to work with. The while loop runs through each player that is pulled and writes the <option> line for each player. Make sense? Hope this helps, Switch
  8. Hello all,   I am hoping you can help me with what I am sure is a very simple issue. I need to keep track of the date and number of times certain links are clicked. To do that I've written a little script that pushes in the linkID and the date it was visited to a mysql db when that page is visited. The DB looks something like this:  [code]      LinkID  clickdate        604   2006-11-08       111   2006-11-08       111   2006-11-08       111   2006-11-08       229   2006-11-09       662   2006-11-09       183   2006-11-25       229   2006-11-09       183   2006-11-09 [/code] You'll note that LinkID 111 got hit 3 times on the same day. LinkID 183 got hit twice. When I output this I want to show LinkID: 111 Hits: 3 LinkID: 183 Hits: 2 LinkID: 229 Hits: 1 etc... I can't figure out the correct way to count this out of the query. Doing a select all and running it through a while loop lets me pull everything out, but somewhere there in the middle I have to add up the duplicates. Any thoughts appreciated!! -Switch
  9. I got it. Trick is to do it in reverse. Get the total number of files, start at the end and do the writes backwards. That way you aren't incrementing what you just changed. Thanks anyway, -Switch
  10. Well, I know why the while loop doesnt work. I am incrementing what I already incremented.  I am SOOO dumb. i.e. I say set step5 to 6, set step 6 to 7, etc and since it runs one at a time the I just set 5 to 6 so not I am setting that same step to 7 so eventually they all equal the highest possible number. So, can't do this in a while loop.. Any thoughts? -Switch
  11. I don't know exactly how your script is set up, but to send in HTML you'll want to output this to the headers: "Content-Type: text/html; charset=\"iso-8859-1\"\n" "Content-Transfer-Encoding: 8bit\r\n\r\n"; Hope that helps a little. -Switchdoc
  12. Hello,   I am hoping you can give me a hand with this. It's basic but I can't get it to work. I have a mysql table with a bunch of steps in it: instruction1 "do this" instruction2 "do that" instruction3 "do the other thing". What I am trying to do is allow a user to add a step in the middle and then re-write the id numbers so they are still in order. i.e. the user would add instruction2 "do something different" and i would end up with: instruction1 "do this" instruction2 "do something different" instruction3 "do that" instruction4 "do the other thing". I've tried doing this in a while loop: (frameid is the number I am trying to increment)(I am limiting at the frame number the user wants to add at, and 2000 because I know there will never be that many steps) [code] $update = "select * from tutorialfiles2 where tutorial='$tutorial' limit $frameidupdate, 2000"; $result = mysql_query($update) OR DIE ("There was an error" .mysql-error()); while ($line = mysql_fetch_array($result)){ $frameid = $line["frameid"]; $stepname = $line["stepname"]; $frameid2 = $frameid++; echo "<br><br>$frameid - $stepname <br>"; $change = "update tutorialfiles2 set frameid='$frameid2' where frameid='$frameid'"; $done = mysql_query($change) OR DIE ("There was an error" .mysql_error()); [/code] but what I get is, for example: instruction1 "do this" instruction2 "do something different" instruction4 "do that" instruction4 "do the other thing". its not incrementing, its just adding the highest possible step. Any thoughts appreciated. I'll be around if you need more info as I realize this is clear as mud. Thanks, Switchdoc
  13. Again thanks for the reply. Added the changes suggested by folks so far. Here again is the code: [code]$ssInfo =  "var point = new GLatLng(" . $location . ");"; $ssInfo .= "var marker = createMarker(point,\"$name\",\'<div id=\"infowindow\" style=\"white-space: nowrap;\">"   . addslashes($row['name'])   . $spacer   . addslashes($row['address'])   . $spacer   . addslashes($row['city'])   . $comma   . $space   . addslashes($row['state'])   . $spacer   . addslashes($row['zipcode'])   . $doublespacer   . addslashes($row['description']) . "</div>\');\n"; $ssInfo .= "map.addOverlay(marker);\n"; $ssInfo .= "\n";[/code] And here is the result: [quote]var point = new GLatLng(39.925112 , -105.087608);var marker = createMarker(point,"Broomfield Location",\' Broomfield Location 123 w smith Broomfield, CO 80020 Email: broomfield@company.com '); map.addOverlay(marker); [/quote] Still no div :( Any other thoughts?
×
×
  • 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.