Jump to content

virtuexru

Members
  • Posts

    200
  • Joined

  • Last visited

Everything posted by virtuexru

  1. Trying to echo out a variable like: $SelOffersQryRow->spid Now, same DB but the column name has a space in it, how am I supposed to properly echo it out? $SelOffersQryRow->Model Detail am I supposed to use `` or '' or "" Thanks!
  2. OK, that's fine. Better than before! Now just use trim() or str_replace().
  3. Why don't you format them together BEFORE the query? example: <?php $newstring = $licen.",".$reso; ?> Then when you put it in make sure its <?php SET sublicenses = '$newstring' WHERE .... etc ?>
  4. I would agree that is best practice, and to cache it locally. But I presume he doesn't want a link to a real local copy either. All the best Keith How would I go about saving a local copy automatically?
  5. That's not the method I asked for, thanks though. Anyone else have any ideas? Maybe its possible not through PHP but through Javascript?
  6. We have a data feed from another website that we pay for. Images are a part of this feed (they feed us their updates links into a MySQL database). I don't want people seeing where the images are being fed from though, that is the problem.
  7. How would I mask where my images are being downloaded from (like the images on www.domain1.com are hosted on www.domain2.com, but I do not want people knowing that the images are coming from www.domain1.com).
  8. Hey everyone.. OK, my basic idea is this. I have an auction website. It has a countdown.. all the auctions end once a night at 9:00PM. Basically, since people are sending bids all the time, I wanted to know how I would going about developing a "ticker".. Like everytime an offer is placed (Query to a MySQL db) I can display (Query that db + AJAX + PHP) what the offer was (amount$) and on what item (id#) it was on. Everytime a bid is submitted, it would pop up the new information on the "ticker". Can anyone link me or post some thoughts on how I would begin? Maybe a tutorial? Thank you so much ahead of time!
  9. OK.. basically I'm doing a math project in PHP for a friend. He puts in an initial number into a MySQL database.. say 100. I need to run a script that when I enter a maximum say 1000, the page showing the number will go up by 50 every 30 minutes.
  10. But I need to run the script every 30 minutes or no?
  11. Like say I want to update a page that has a countdown on it for a number... The max for that number is 800 for instance.. I set that to be the maximum, then if the number on the page is less than that, I can add 100 every 30 minutes until it is equal to or greater than 800. How would I go about doing this in PHP without having to manage the page after I set the initial maximum?
  12. OK, so I have populated a table, I was wondering if I can run this to check if the table DOESNT have a certain ID number, then an update function can add a new row, is this coherent or am I retarded? Here is my code: <?php $ListQuery = "SELECT * FROM relist where vid='".addslashes($tlist[7])."'"; $ListQueryRS = mysql_query($ListQuery); $TotList = mysql_num_rows($ListQueryRS); if($TotList>0) { mysql_query("UPDATE relist SET newdate = '".$AuctionDate."' WHERE vid = '".addslashes($tlist[7])."'"); } else { mysql_query("UPDATE relist SET id='', vid = '".addslashes($tlist[7])."', origdate='".$AuctionDate."', newdate='".$AuctionDate."'"); } ?>
  13. Quick question, I'm having a brainlapse right now. I want to take a url like this: http://anywhere.com/x/bw/bbbb/vid?lot=6874699 and extract just the number after "lot=" so I just need the numerical value. What's the most efficient way of doing this? Substr? (the number can be anywhere from 5-8 numerals).
  14. Hey guys. Mondays suck. I've been asked to write a script to determine how many vehicles have been added by employees in the past WEEK. So basically, I would need a count on employees for who had the most vehicles posted in the past one week. My database is setup like this: Row Name: _author can contain any persons e-mail for example: "person1@whatever.com" or "person3@whatever.com". Row Name: _added is the DATE the person posted the vehicle in this format: YYYY-MM-DD. Now, how would I go about counting who had the most posts in the past week? Anyone have any ideas? I've tried a few things with mktime but alas, no avail. Here is my SQL for vehicle postings for ALL-TIME (not one week) just for reference: $count = "SELECT DISTINCT _author, COUNT(_author) AS count FROM dbname GROUP BY _author ORDER BY count DESC LIMIT 10";
  15. Probably a really stupid question, I'm trying to match two URLS to check for duplicates, keep getting an error, here is my code: <?php $id = "6096899"; $lotch = "http://web.website.com/cgi-bin/buyer/lotdetail.dtw/disp?lot=".$id; // $lotch is the same as _alink in table, _alink is: "http://web.website.com/cgi-bin/buyer/lotdetail.dtw/disp?lot=6096899" $query = "SELECT * FROM vehicles WHERE $lotch = _alink"; $result = mysql_query($query) or die(mysql_error()); if(mysql_num_rows($result) > 0) { die("Duplicate"); } ?> Error I'm getting:
  16. Hey everyone, I just wanted to know what your best approach would be to my problem. I have a date in this format: 1/27/09 I need to be able to convert it into this format: 2009-01-27 Anyone got any ideas?
  17. OK, so far I have also tried this, it looks like it should work but I'm getting an output of just some blank arrays. <? // Find date $pattern = '#^(\d{1,2})[/-](\d{1,2})[/-](\d{4})$#'; preg_match_all($pattern, $data, $date); // Print print_r($date); ?>
  18. OK PHP Gurus, another question . I'm really struggling to get this down pact so I'm sorry if my questions are redundant. Just trying to get things to work :-P. Here is the HTML code I have: <td align="right">Sale Date :</td> <td align="LEFT" colspan="2"> 1/26/09 </td> My goal is to EXTRACT the date "1/26/09" (could be ANY date at ANY given time, so basically its always unique) into a separate variable. How should I go about doing this? I tried something like this but it didn't work: // Find date $pat = "%\A(?:^(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)[0-9]{2}$)\Z%"; preg_match_all($pat, $data, $date); print_r($date);
  19. Yep much nicer than my way =P Your way still worked, helped me figure out exactly what I needed. Thanks again!
  20. Awesome. Thank you Mchl! That worked, I was wondering if there was anyway to do this with ereg so I don't have to run this 8 times (for 8 images)? Would something like this work or am I retarded: <?php $reg_ex = '.JPG'; $replace_word = "X.JPG"; ereg_replace($reg_ex, $replace_word, $images); ?>
  21. PHP Gurus! How would I be able to take one of my arrays, which for example is: $images[1][1]; which contains: h**p://website.com/website/data/pix/20081119/19667358_1.JPG Basically, what I need to do is add an "X" right after BEFORE the ".JPG" so the result needs to be: h**p://website.com/website/data/pix/20081119/19667358_1X.JPG Anyone got any ideas?
  22. Figured it out: <?php $pattern = "/src=[\"]?([^\"]?.*(jpg))[\"]?/i"; preg_match_all($pattern, $data, $images); ?>
  23. Hey everyone . I have a script that puts an HTML page into a variable called $data. Basically, what I need to do now, is extract a certain part of the script into its own variables (array). There are six images that I need off the page to be put into separate variables. Here is the code for the images: <img src="http://somewebsite.com/website/website/pix/20081119/19667358_1.JPG?" width=96 height=72 border=0> <img src="http://somewebsite.com/website/website/pix/20081119/19667358_2.JPG?" width=96 height=72 border=0> <img src="http://somewebsite.com/website/website/pix/20081119/19667358_3.JPG?" width=96 height=72 border=0> Now, say I wanted to JUST extract the BOLDED part, how would I go about doing that? h**p://somewebsite.com/website/website/pix/20081119/19667358_3.JPG Or maybe just extracting the whole URL would be easier? Either one would work. Thanks in advance PHP Gurus!!
×
×
  • 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.