Jump to content

ryanwood4

Members
  • Posts

    100
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

ryanwood4's Achievements

Member

Member (2/5)

0

Reputation

  1. Never used this before. How would that be implemented? Here's my code. I'm guessing it would go within the mysql_query? <?php $con = mysql_connect("localhost","XXX","XXX"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("XXX", $con); $result = mysql_query("SELECT * FROM `articles` WHERE `id` NOT LIKE '%$id%' and `category` NOT LIKE '%paddock%' ORDER BY `date` DESC LIMIT 0,10"); while($row = mysql_fetch_array($result)) { echo '<div class="menu"><div class="item">'; echo '<h1><a href="news/display/'.$row['id'].'">'.$row['title'].'</a></h1>'; echo '<img src="../../'.$row['image'].'"/>'; echo '<p>'.$row['body'].'</p>'; echo '</div></div>'; } mysql_close($con); ?>
  2. Hi, I can't figure out how to limit the word count fetched from the database. I simply want to show 10 words from the 'body' column. I'm using the below echo code to display the information. echo '<div class="menu"><div class="item">'; echo '<h1><a href="news/display/'.$row['id'].'">'.$row['title'].'</a></h1>'; echo '<img src="../'.$row['image'].'"/>'; echo '<p>'.$row['body'].'</p>'; echo '</div></div>'; Any help is appreciated. Thanks.
  3. Does anyone know of any scripts to output the meta data from an image? I've had a look around and I can't see a simple script which displays basic image meta data, such as title, tags, camera used, etc. Thanks.
  4. Thanks. I'll give that a go. However, that might work out the size, but how can I access and output all the data stored in the images properties, i.e. Title, description, tags, device make, model etc???
  5. Hi, I'm not 100% sure if this is HTML, PHP or Javascript, but my best guess is PHP. When you upload an image on Facebook, it automatically gathers the data about the image, i.e. size, device used (i.e. Canon, iPhone), title and description. It then outputs this on the page. Is there anyway to do this with PHP, instead of having to type all the information out again and upload that with the photo to a database? Cheers.
  6. I tried that, unsuccessfully though, not quite sure how to implement it correctly. Any help would be much appreciated.
  7. I'm using the fairly simple below code to output a list of the latest articles, but I'm wanting (not sure if it's possible) to display the articles from the current day in bold so users recognise that they are new and the older ones non-bold. I've tried a few things, but they're not giving the desired results. <?php $con = mysql_connect("localhost","xxx","xxx"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("xxx", $con); $result = mysql_query("SELECT * FROM `articles` WHERE `quotes` NOT LIKE '%yes%' ORDER BY `date` DESC limit 0,14"); echo "<table class='links' border='0' width='100%'>"; while($row = mysql_fetch_array($result)) { echo '<tr><td width="270" valign="top"><h4>» <a href="news/display/'.$row['id'].'">'.$row['title'].'</a></td><td width="40" valign="top"><span class="small">'.date("M d", strtotime($row['date'])).'</span></h4></td></tr>'; } mysql_close($con); ?> Cheers!
  8. Cheers, works great. I now know what I was doing wrong too. Thanks.
  9. Yep: ip | Varchar (20) It's in the same table as the comments: 'articlecomments'
  10. Hiya, I'm trying to track the IP address of users leaving comments, however I am struggling to integrate it into the code (below), several attempts have failed. $_POST['comment'] = str_replace("'", "\'", $_POST['comment']); $sql="INSERT INTO articlecomments (articleID, posterNickname, email, comment) VALUES ('$_GET[id]','$_POST[name]','$_POST[email]','$_POST[comment]')"; mysql_query($sql); Any help is, as always, greatly appreciated. Thanks in advance.
  11. The longish code is in the database under the row 'poll' - which is what I'm trying to echo - it shows up in the source, but it doesn't show up on the page. If you look at this page: http://www.thef1times.com/news/display/00001 - it doesn't show the poll at the bottom of the text (main article text), but if you check the source code, it does display the echoed code - however the code isn't doing what it would, if it was simply added to the page.
  12. Hi, How do you go about including the below code on a page? I have added it to the database, and I'm using an echo function to display it, but it doesn't seem to work, is there anything special you need to do to echo code? The code I need to echo: <?php include("poll/Poll.php"); echo Poll(1, "poll/template.tpl", "poll/data.xml"); ?> I've used <? echo $poll?> to echo it, but it doesn't show anything. Thanks (not sure if that made much sense, but it's hard to explain)
  13. The format is (example): 2010-02-28 12:17:37
  14. Don't seem to be getting any results with that?
×
×
  • 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.