Jump to content

Row and column data


apr1515

Recommended Posts

ok, let see if is that that you want:

<?php  
$connection = mysql_connect("host", "username", "password") or die(mysql_error());
//Connection to the database. Error out if the connection fails for 

@mysql_select_db('yourdatabasename');
//Select the database

$query = mysql_query("SELECT * FROM tablename WHERE id = 7");
$row = mysql_fetch_array($query);
echo 	"<h1>" . $row['description'] . "</h1>";     
?>

In this example, let supose that your column3 name is "description" and the 3rd row of your table have the id 7

 

hope i'v been useful.

 

Best regards,

Moreira

Link to comment
https://forums.phpfreaks.com/topic/221363-row-and-column-data/#findComment-1146047
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.