Jump to content

pkhandelwal

Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Everything posted by pkhandelwal

  1. if I wanted to add more conditions to the original code, could I do this: $sql_titles = "SELECT * FROM `wp_posts` WHERE post_status = publish ORDER BY ID DESC LIMIT 0, 5"; (i added the where post_status equals publish.)
  2. if I don't have a static link at this point, is there a way to make a dynamic link to a page which will grab all the appropriate information for that specific title that you click on?
  3. Thanks a bunch. My output is 'Test 3Test 2Test' which is what it should be. Does anyone have any formatting tips on how I can get the output to come as a list? example: test 3 test 2 test ? In the end what I'm trying to do is have each of these headlines that are output act as links to those articles. Is that overly complicated or is that doable? If so, where do I start, and how do I go about doing it? Sorry I know I'm being a hassle, but I've spent days and I've had no progress.
  4. but the code still only spits out one title (the newest one now), even though I told it to list three (as I put the limit). What should I do?
  5. so I used what you guys said and this is the new code: <?php $sql_titles = "SELECT * FROM `wp_posts` LIMIT 0, 3"; $titles = mysql_query($sql_titles); $realtitles = mysql_fetch_object($titles); echo $realtitles->post_title; ?> The only thing is it only recalled one title, and at that it recalled the oldest title. I was trying to recall the newest 3 titles. Any other ideas? Would greatly appreciate...
  6. hello all, So I was trying to use PHP to grab from a mysql database (a wordpress one, for those who are curious). I feel like my code makes sense, but it isn't outputting anything. help? <?php $titles = mysql_query("SELECT * FROM `wp_posts` LIMIT 0, 3"); $realtitles = mysql_fetch_object($titles); echo $realtitles; ?>
×
×
  • 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.