Jump to content

phantom552

Members
  • Posts

    12
  • Joined

  • Last visited

phantom552's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Made a little progress, but I know my syntax is fubar on the $xml line, trying to add $value between http://www.website.com/item= and &xml so I end up with http://www.website.com/item=____&xml where ____ is a value in the range. Any help is appreciated. $possibleids = range(1,100); foreach ($possibleids as $value){ $xml = 'http://www.website.com/item=$value&xml'; }
  2. Let's say I have a laundry list of *possible* XML files with a sequential commonality, IE: http://somewebsite.com/archivedthing/1.xml to http://somewebsite.com/archivedthing/100000.xml With no way of knowing beforehand how many of the possible XML files in that range are valid. Is there a way to automatically run through all of these URLs and dump the valid numbers into a delimited file of some kind? I think I can figure out how to check each URL for the presence of the XML data I want, but I'm not sure how to automatically progress through each possible URL, and dump the data I need into a file I can use later. Thanks!
  3. <?php $json = file_get_contents('http://us.battle.net/auction-data/6de1a23eb7316db413a62771c8f16b93/auctions.json'); var_dump($json); var_dump(json_decode($json)); ?> Returns: bool(false) NULL
  4. My brain is currently at it's threshold for processing this sort of thing on it's own, and I've been circling this challenge for hours with no success. Is there a way to take a JSON file (http://us.battle.net/auction-data/6de1a23eb7316db413a62771c8f16b93/auctions.json) And turn it into something I can use with PHP to reorganize and display the data in a way that makes sense? IE: Realm - Player Name - Item ID - Quantity - Bid - Buyout - Timeleft Preferrably in a CSV or MySQL DB so I ca simply foreach() the entire thing I apologise if I am not making a whole lot of sense, I am just at my wit's end.
  5. Sumpygump, I came to that conclusion right before reading your post lol. I shouldve just ran the query inside PHPmyA to begin with. Oh well, live and learn
  6. Got it! Thanks for the brainstorming session!
  7. OK, sorry for the ambiguity. Here is what I currently see on-page: 105201030-105200989-20256 SKU bool(false)hello Which are the variable echos, the var_dump line, and "hello" echo. If I run the SQL query directly in my database as "SELECT * FROM Ammunition WHERE SKU = 105201030-105200989-20256", I get nothing but: MySQL returned an empty result set (i.e. zero rows). ( Query took 0.0003 sec ) Which I find odd since if I enter PHPMyAdmin and open the table in question, the 4th row of the table has "105201030-105200989-20256" in the SKU column. All in all, I assume my query syntax is fubar somewhere.
  8. Adding a var_dump line greets me with: resource(7) of type (mysql result) additionally, the 2 variables are not set in the code shown, they are set earlier and echoed, $dbrow being the title of the column I want to query ("SKU") and $SKUID being a product SKU carried over from the previous page in the URL & retrieved with $_Get To be clear, I am attempting to retrieve data (Product photos, descriptions, & such) from a single row of my 'Ammunition' table in which the value of the SKU colum matches the value stored in $SKUID. I apologise if I sound like an idiot, but I just started using PHP yesterday, so this is a learning experience.
  9. Also this is run in a local development environment where I have full server access & control, if that information helps anybody.
  10. I can't seem to get this thing to work.... 2 hours I've been tinkering with it to no success. The query itself seems to run, but when I try to echo the results nothing happens aside from the 'hello' & HTML code echos. Anyone see a blatant flaw in my code? the SKUID & DBROW echos are a test to make sure theyre set when I load the page, and they are perfect. I should also mention that dbrow is actually a column of the MySQL database, im not sure why I went with 'row' in the variable. include 'php/opendb.php'; echo $skuid; echo $dbrow; mysql_select_db("brownells_api_data") or die(mysql_error()); $query = "SELECT * FROM Ammunition WHERE $dbrow = $skuid" or die(mysql_error()); $sql = mysql_query($query); $row = mysql_fetch_array($sql); $prodimg = $row['Thumbnail Image']; echo $row['Thumbnail Image']; echo "<div class=toparea>"; echo "<div class=imgarea>"; echo "$prodimg"; echo "</div>"; echo "</div>"; echo $row['Description']; echo 'hello';
  11. Thanks for the input, I am familliar with the mod rewrite rule & plan to use it once I get the base functionality set up, more just looking for basically how to A) generate a page that has the PID appended to the URL, then strip the PID back out of the url to store it as a variable for use in a query, which it looks like you showed me in the first half of your response. Thank you again! lol. Most of the time I know what I want in my head and just can't think of how to make it appear in the scripting >.<
  12. So I set up my "Ecommerce" site (ecommerce being used loosely since it's technically more of an affiliate site), got the home page done, and used a PHP mysql query to build out the category pages (yay for echo "<div>" and CSS + PHP/mySQL). My question now is how do I go about adding single product pages without having to create each one individually? Each product has a unique ID in the DB table, is it possible to dynamically generate a link such as mysite.com/products.php?PRODUCTID then have that actually lead to a page populated with the table row data for that product? If so, how would I go about doing that? Will search engines still index a page generated in this fashion? Thank you for your help, I just started in on PHP programming this morning, so you could call me a novice for sure!
×
×
  • 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.