Jump to content

Echoing info by ID


blink359

Recommended Posts

Have you attmepted this, used php/mysql before? Some code will help. If you haven't tried yet I recommend you do as no-one is going to write this for you. Though it is a very simple application, just looking at the mysql_query syntax on the php.net website will probably sort this out for you.

Link to comment
https://forums.phpfreaks.com/topic/157505-echoing-info-by-id/#findComment-830439
Share on other sites

Have you attmepted this, used php/mysql before? Some code will help. If you haven't tried yet I recommend you do as no-one is going to write this for you. Though it is a very simple application, just looking at the mysql_query syntax on the php.net website will probably sort this out for you.

 

What he said, except the part where no one will write it for you. I am feeling generous.

 

here

 

<?php

$query = @mysql_query("SELECt * FROM `table` ORDER BY `id` DESC LIMIT 5");

if($query){

  while($row=mysql_fetch_array($query)){


   $row['text'] . '<br>';

  }


}

?>

Link to comment
https://forums.phpfreaks.com/topic/157505-echoing-info-by-id/#findComment-830446
Share on other sites

What he said, except the part where no one will write it for you. I am feeling generous.

 

here

 

<?php

$query = @mysql_query("SELECt * FROM `table` ORDER BY `id` DESC LIMIT 5");

if($query){

  while($row=mysql_fetch_array($query)){


   $row['text'] . '<br>';

  }


}

?>

 

I was wrong there are some people here that will write it for you, but I wouldn't supress errors using the @ symbol.

 

@mysql_query("SELECt * FROM `table` ORDER BY `id` DESC LIMIT 5");

 

You want to know if there's an error!

 

<?php
$query = mysql_query("SELECT * FROM `table` ORDER BY `id` DESC LIMIT 5") or die("Error: ".mysql_error());

Link to comment
https://forums.phpfreaks.com/topic/157505-echoing-info-by-id/#findComment-830456
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.