Jump to content

icor1031

Members
  • Posts

    13
  • Joined

  • Last visited

icor1031's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks, both of you gents. By self employed, do you mean selling scripts in a marketplace, or contract work? My preference is to for a dev firm or do contract work, but that's only because I don't know if I'd be successful with my own ideas like abdul is.
  2. I've been learning programming with the hope of being able to get work at home with decent pay and semi-reliable job offers. However, I'm disabled and it would be difficult to work on-site. Is it a waste of time, am I going to have great difficulty finding work?
  3. I posted this on stackoverflow, but no one wanted to touch it. http://stackoverflow.com/questions/25903927/mysql-reverse-new-entries I've tried array_push, but the results remain as SimpleXML, and not a plain array, which I wasn't able to use. I tried some other things that I can't remember. $feed_url = 'http://feeds.feedburner.com/SlickdealsnetFP?format=xml'; $contents = file_get_contents($feed_url); $x = new SimpleXMLElement($contents); $arrayFPTitle=array(); foreach($x->channel->item as $temp){ array_push($arrayFPTitle, $temp->title); } Have any suggestions?... I've been on this problem for a few hours, now. I even tried regex, but you can imagine I quickly realized I wasn't going to figure that out.
  4. Yes, I was confused with the precedence. And it was quite a silly mistake to use assignment . Thanks!
  5. This is what I want: If comparisonTimeH isn't zero, I want it to check if comparisonTimeH is zero, and comparisonTimeM is larger than or equal to 2. If so, I want it to pass and run the script. This is what I have, and it's not right. It runs the else statement, echo test 2. if ($comparisonTimeH != 0 || $comparisonTimeH = 0 AND $comparisonTimeM >= 1) { echo "test"; } else { echo "test2"; } echo "<br />" . $comparisonTimeH . " " . $comparisonTimeM; My last echo, the one outside of the if statements - it returns 0 and 12. Thus, both conditions that I'm trying to get, are true. My if's logic is clearly wrong, and I can't figure out what operators to use. If I change the AND to &&, it breaks and my final echo doesn't return comparisonTimeH (it's blank). Please teach me, thanks!
  6. It works, and I believe it's marked as solved now. Thanks, gentlemen.
  7. It was because I didn't use $lastPIDreduced when I called the function, oops! function getResults($con,$lastPIDreduced) { $y = 0; echo $lastPIDreduced; $results = mysqli_query($con, "SELECT * FROM Entries ORDER BY PID DESC LIMIT 0,8"); while ($rowFp = mysqli_fetch_array($results)) { echo "<br /><br />" . $rowFp['Title'] . "<br />" . $rowFp['remoteTime'] . "<br /><br />" . $rowFp['PID']; } } getResults($con);
  8. I can't figure out how I'm messing up so badly. Anyway, I have: $con=mysqli_connect("removedforsecurity"); $finderCleanup = mysqli_query($con, "SELECT * FROM Entries ORDER BY PID DESC LIMIT 1"); $finderCleanupArray = mysqli_fetch_array($finderCleanup); $integerCleanup = $finderCleanupArray['PID'] - 40; $lastPID = $finderCleanupArray['PID']; $lastPIDreduced = $finderCleanupArray['PID'] - 8; When I var_dump $lastPID, it returns INT with a number (it works correctly.) Then, I have this: function getResults($con,$lastPIDreduced) $con works correctly in the function, but $lastPIDreduced is "undefined." What is my sin? Thanks.
  9. I "fixed" it, by adding the third line. I'm not satisfied with that result, but it works. For some reason, the while statement started one item too late. $results = mysqli_query($con, "SELECT * FROM Entries ORDER BY PID DESC LIMIT 0,8"); $rowFp = mysqli_fetch_array($results); echo "<br /><br />" . $rowFp['Title'] . "<br />" . $rowFp['remoteTime'] . "<br /><br />" . $rowFp['PID']; while ($rowFp = mysqli_fetch_array($results)) { echo "<br /><br />" . $rowFp['Title'] . "<br />" . $rowFp['remoteTime'] . "<br /><br />" . $rowFp['PID']; Here, you see my last PID: Here, you see that my PID began (before my "fix") one number higher than what exists in the database: Column stuff:
  10. Woops, I misunderstood this: http://www.w3schools.com/sql/sql_top.asp I've been using limit, but the problem is that it doesn't call the most recent entry - even if I use LIMIT 0,8. And LIMIT -1,8 gives an error. Should I find the PID, then +1 it? Any advice? Thanks!
  11. $results = mysqli_query($con, 'SELECT TOP 8 * FROM Entries'); var_dump($results); This gets me bool(false) ------------ $results = mysqli_query($con, "SELECT * FROM Entries ORDER BY PID DESC LIMIT 9"); But, this gets me the proper results - it draws from my database, like it should. Why do I get false, when I use TOP 8? Thanks.
×
×
  • 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.