Jump to content

ctcp

Members
  • Posts

    170
  • Joined

  • Last visited

    Never

Everything posted by ctcp

  1. can sombady help me here ? <?php $UserID=''; $APIKey=""; $CharID=''; $XMLpath = "http://api.eve-online.com/char/WalletJournal.xml.aspx?userID=$UserID&apiKey=$APIKey&characterID=$CharID"; require_once('../header.php'); //for db info $con = mysql_connect($server, $user, $pw); mysql_select_db($db, $con); //********* The following 4 lines create the table. Obviously, this only needs to be run once and then commented out *********\ mysql_query("CREATE TABLE IF NOT EXISTS walletJournal ( ID int NOT NULL AUTO_INCREMENT, PRIMARY KEY (ID), refID int, date datetime, ownerName tinytext, ownerID int, amount int, reason tinytext, handled char(1) )", $con); function recursive_wallet_walk($XMLpath, $lastID) { if ($lastID) //if we have a lastID, request a journal walk (this is the recursive part of the function) $path = $XMLpath . "&beforeRefID=" . $lastID; else //just a normal query $path = $XMLpath; echo "Loading $path\n\n\n"; $s = simplexml_load_file($path); if (!$s)//url error { echo "Error: HTTP Error of some sort."; die(); } $curr_time = $s->currentTime; $expires_on = $s->cachedUntil; $expires_on_local = time() + (strtotime($expires_on) - strtotime($curr_time)); echo "File expires on: $expires_on_local\n"; $file=fopen("expiration.cache","w");//write the cached time file fwrite($file, "$expires_on_local"); fclose($file); if ($s->error != '') //error condition { echo "Error: " . $s->error; return; } foreach ($s->result->rowset->row as $entry) { $values = array(); foreach($entry->attributes() as $a => $b) //load all the entry's attributes into the values array { $values[$a] = mysql_real_escape_string($b); } if ($values[refTypeID] == 10) //reftypeID is 10 for a player donation { echo "In refID " . $values['refID'] . ", owner ". $values['ownerName1'] . ", userID " . $values['ownerID1'] . ", gave me " . $values['amount'] . " ISK for the reason: \"" . $values['reason'] ."\" on " . $values['date'] . "\n"; $result = mysql_query("SELECT * FROM walletJournal WHERE refID='{$values['refID']}'"); if (mysql_num_rows($result) > 0) { //This refID has already been stored... move along echo "got to a refID that's already been stored... we're outta' here"; return; } else { //this refID has not been stored, store it echo "Let's store this value!\n"; mysql_query("INSERT INTO walletJournal (refID, date, ownerName, ownerID, amount, reason, handled) VALUES ('{$values['refID']}','{$values['date']}','{$values['ownerName1']}','{$values['ownerID1']}','{$values['amount']}','{$values['reason']}', '0')"); } } } //we got to the end of the foreach array.... which means we have not gotten to a value that we've already seen! //we need to do the journal walking echo "-------====Doing a journal walk!===-------\n"; recursive_wallet_walk($XMLpath, $values['refID']); return; } recursive_wallet_walk($XMLpath, ''); ?> i don't have header.php what i need to write in header.php
  2. <?php //$data['date'] = "2009-08-04 09:50:35"; $display = date('y/m/d', strtotime($data['date'])); if($display == date('y/m/d', time())) { $display = "Today"; } elseif($display == date('y/m/d', (time() - 86400))) { $display = "Yesterday"; } echo $display ?> this working fine for me ..
  3. thanks mate for your help but now i see only Today not working good maybe here need change? $data['date'] = "2009-08-04 09:50:35"; add my server time?
  4. <?php $results = mysql_query("SELECT * FROM table WHERE type = '$type' and options = 'Yes' and topic LIKE '%". $query ."%' ORDER BY date DESC LIMIT $page, $limit"); while ($data = mysql_fetch_array($results)) { ?> <?=$data["date"]?> <? } ?> in my DB i got colum timestamps now i see my time like this 2009-08-04 09:50:35 how to view like this 09/08/04 and how to view if its today view today or yesterday thank you for help
  5. i mean if i got result from my database 1000 chars ... i whant show only the first 100 chars..
  6. how to view only first 100 chars in my php result page .. <?=$data["name"]?>
  7. can help me pls how to? im new in php header("Location: /test".$_GET['type']."/?query=".$_GET['query']."&type=".$_GET['type']); add this line where?
  8. not help but thanks mate alot maybe sombady help me :-)
  9. no you don't understant .. i got 2 directoris one is test1 and test2 i whant make one texfield list menu search button if i search for TEST (texfield) and select options 1 (form list menu) i whant my search redirect me to mysite.com/test1/?query=test&type=1 type is my options from list menu if i search for TEST (texfield) and select options 1 (form list menu) i whant my search redirect me to test2/?query=test&type=2
  10. i got texfield (for search) list menu (1 or 2) and Button (Search) how to if i search test type 1 (i whant this result to my page) mysite.com/1/?query=test&type=1 if i search test type 2 (i whant this result to my page) mysite.com/2/?query=test&type=2 <form name="form1" method="get" action=""> <label for="query1"></label> <input type="text" name="query1" id="query1"> <label for="type"></label> <select name="type" id="type"> <option value="1">1</option> <option value="2">2</option> </select> <label for=""></label> <input type="submit" value="Search"> </form> Thanks for the Help
  11. yes this working but how to redirect to difrent url if i search test type 1 (i whant this result to my page) mysite.com/1/?query=test&type=1 if i search test type 2 (i whant this result to my page) mysite.com/2/?query=test&type=2
  12. i got texfield (for search) list menu (1 or 2) and Button (Search) how to if i search test type 1 (i whant this result to my page) mysite.com/1/?query=test&type=1 if i search test type 2 (i whant this result to my page) mysite.com/2/?query=test&type=2 <form name="form1" method="get" action=""> <label for="query1"></label> <input type="text" name="query1" id="query1"> <label for="type"></label> <select name="type" id="type"> <option value="1">1</option> <option value="2">2</option> </select> <label for=""></label> <input type="submit" value="Search"> </form> Thanks for the Help
  13. i got textfield for search .. and list menu Games or Apps + search button .. if i select Games my search will go to games.google.com?query=mplamplampla if i select Apps my search will go to apps.xgoogle.com?query=mplamplampla
  14. thanks mate for the help .. but now working like Jump menu i need List menu
  15. <form method="GET" action="http://google.gr"> <input name="query1" type="text" id="inputString" autocomplete="off" onblur="fill();" onkeyup="lookup(this.value);" size="30" /> <label for="type"></label> <select name="type" id="type"> <option value="Games" <?php if (!(strcmp("Games", $type))) {echo "selected=\"selected\"";} ?>>Games</option> <option value="Apps" <?php if (!(strcmp("Apps", $type))) {echo "selected=\"selected\"";} ?>>Apps</option> </select> <button type="submit">Search</button> How To.. if i select Games --> go to games.google.com if i select Apps --> go to apps.google.com
  16. select * from google WHERE topic LIKE '%a%' order by date DESC LIMIT 0, 2You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'limit 0,2' at line 1
  17. <?php if(trimmed1 || $trimmed2 || $trimmed3 || $trimmed4) { $query = "select * from google WHERE "; if($trimmed1 !='') { $query .= " topic LIKE '%$trimmed1%' AND"; } if($trimmed2 !='') { $query .= " upload LIKE '%$trimmed2%' AND "; } if($trimmed3 !='') { $query .= " type LIKE '%$trimmed3%' AND "; } if($trimmed4 !='') { $query .= " date LIKE '%$trimmed4%' "; } if(substr($query, strlen($query)-4, 4) == ' AND') { $query = substr($query, 0, strlen($query)-4); } $query .= " order by date DESC "; echo $query; // ?> this working fine but i whant add $limit and $page and not working ... <?php if(trimmed1 || $trimmed2 || $trimmed3 || $trimmed4) { $query = "select * from google WHERE "; if($trimmed1 !='') { $query .= " topic LIKE '%$trimmed1%' AND"; } if($trimmed2 !='') { $query .= " upload LIKE '%$trimmed2%' AND "; } if($trimmed3 !='') { $query .= " type LIKE '%$trimmed3%' AND "; } if($trimmed4 !='') { $query .= " date LIKE '%$trimmed4%' "; } if(substr($query, strlen($query)-4, 4) == ' AND') { $query = substr($query, 0, strlen($query)-4); } $query .= " order by date DESC LIMIT $page, $limit"; echo $query; // ?> LIMIT $page, $limit select * from google WHERE topic LIKE '%a%' order by date DESC LIMIT 0, 2Couldn't execute query
  18. <? $var1 = @$_GET['q1'] ; $var2 = @$_GET['q2'] ; $var3 = @$_GET['q3'] ; $var4 = @$_GET['q4'] ; $trimmed1 = trim($var1); $trimmed2 = trim($var2); $trimmed3 = trim($var3); $trimmed4 = trim($var4); if(trimmed1 || $trimmed2 || $trimmed3 || $trimmed4) { $query = "select * from google WHERE "; if($trimmed1 !='') { $query .= " topic LIKE '%$trimmed1%' AND"; } if($trimmed2 !='') { $query .= " upload LIKE '%$trimmed2%' AND "; } if($trimmed3 !='') { $query .= " type LIKE '%$trimmed3%' AND "; } if($trimmed4 !='') { $query .= " date LIKE '%$trimmed4%' "; } if(substr($query, strlen($query)-4, 4) == ' AND') { $query = substr($query, 0, strlen($query)-4); } $query .= " order by date asc"; while ($data = mysql_fetch_array($results)) ?> <a href="<?=$data["url"]?> "target="_blank"> <?=$data["topic"]?> </a> <div class="url1">[<?=$data["forum_name"]?>]</div> <div class="url2"> [<?=$data["type"]?>] - <?=$data["date"]?><br> <?=$data["upload"]?> </div> <div class="url"> <?=$data["url"]?><br> </div><br> <? } ?> can sombady help me what is wrong here ?
  19. autocomplete="off" yes :-) thanks mate im searching 30min in google.com for this :-)
  20. i got one TEXT BOX ( search text box) how i can disable the cookies i whant it like google http://www.google.gr/
  21. <?php // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $sql="SELECT * FROM $tbl_name ORDER BY date DESC LIMIT 0, 10"; $result=mysql_query($sql); // Count table rows $count=mysql_num_rows($result); ?> <table width="500" border="0" cellspacing="1" cellpadding="0"> <form name="form1" method="post" action=""> <tr> <td> <table width="500" border="0" cellspacing="1" cellpadding="0"> <tr> <td align="center"><strong>Id</strong></td> <td align="center"><strong>Name</strong></td> <td align="center"><strong>Lastname</strong></td> <td align="center"><strong>Option</strong></td> </tr> <?php while($rows=mysql_fetch_array($result)){ ?> <tr> <td align="center"><? $id[]=$rows['id']; ?><? echo $rows['id']; ?></td> <td align="center"><input name="topic[]" type="text" id="topic" value="<? echo $rows['topic']; ?>" size="100"></td> <td align="center"><input name="url[]" type="text" id="url" value="<? echo $rows['url']; ?>" size="100"></td> <td align="center"><? echo $rows['options']; ?><input name="options[]" type="checkbox" id="options" value="Yes" <?php if (!(strcmp($rows['options'],"Yes"))) {echo "checked=\"checked\"";} ?> /> <label for="options"></label></td> </tr> <?php } ?> <tr> <td colspan="4" align="center"><input type="submit" name="Submit" value="Submit"></td> </tr> </table> </td> </tr> </form> </table> <?php // Check if button name "Submit" is active, do this if($Submit){ for($i=0;$i<$count;$i++){ $sql1="UPDATE $tbl_name SET topic='$topic[$i]', url='$url[$i]', options='$options[$i]', type='$type[$i]' WHERE id='$id[$i]'"; $result1=mysql_query($sql1); } } if($result1){ header("Location: " . $_SERVER['php_SELF']); } mysql_close(); ?> i view 10 result per page how to make one chek box to check all records not one by one ...
  22. ctcp

    search

    i need add another one mysql query?
×
×
  • 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.