display one row of data

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
php_postgresql
Forum Newbie
Posts: 13
Joined: Sat Apr 19, 2008 9:37 am

display one row of data

Post by php_postgresql »

I'm going to display the data of a specified company....
all the data needed are in my database..... i dont know how to


<html>
<?php
$db = pg_connect("dbname=dbsupplier");
$result = pg_exec($db,"SELECT * FROM companyform WHERE company='%$company'%);
$row=0;
$tel=pg_result($result,$row,"tel");
echo "$tel";
?>
</html>


I'm really lost.... I just want to output the contents of the row in a profile look.................... :(
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: display one row of data

Post by Christopher »

Code: Select all

<html>
<?php
$db = pg_connect("dbname=dbsupplier");
$result = pg_exec($db,"SELECT * FROM companyform WHERE company='%$company'%);
$row=0;
$tel=pg_result($result,$row,"tel");
foreach ($tel as $key => $value) {
   echo "$key=$value<br/>";
}
?>
</html>
(#10850)
Post Reply