Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

position x  position y   (positioning myself for echo)

Posted on 2002-05-04
4
Medium Priority
?
198 Views
Last Modified: 2012-05-04
Hi,

I want to echo the reslut of an sql query to a certain
area of my page.  Anybody knows how;

I have a webpage with a few buttons to press on left
hand side.
So what I want is to post the result of my sql query
besides the buttons.
Am just lurning the language so need all the help I can get
and what better place than here;


thanks
0
Comment
Question by:jerbell
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 2

Expert Comment

by:jpoesen
ID: 6990131
<?$query = "SELECT * FROM TblWhatever"

while ($RecSet = mysql_fetch_object($query)){
?>
 <b>fieldname1</b> : <?=$RecSet->Fieldname1?>
 <b>fieldname2</b> : <?=$RecSet->Fieldname2?>
 <b>fieldname3</b> : <?=$RecSet->Fieldname3?>
<?}?>

is this what you were looking for?

0
 
LVL 4

Expert Comment

by:lokeshv
ID: 6990177
ur complete  page..

<?

$qid=mysql_query("select * from urtable");
?>

<html>
<body>
<table width=100% align=center>
<?while($row=mysql_fetch_array($qid)){?>
<tr><td><?=$row[field1]?></td>
<td><?=$row[field2]?></td>   //and so on
</tr>
<?}?>
</table
</body>
</html>
0
 

Author Comment

by:jerbell
ID: 6991191
Sorry was late,
No it's not what I meant.
The code above will print out the result of an sql
under my button(gif)
I want the table to appear at the right of my button and not bellow.  Not even sure if it's possible
I want to be able to output the result at a certain x,y position on my web page.
Or at least to put the result on the right hand side of 3 picture buttons.

example of what I want

[]   result of sql
[]   result of sql  
[]   result of sql

This is what is happening that I don't want

[]
[]
[]
    result of sql
    result of sql
    result of sql
0
 
LVL 1

Accepted Solution

by:
Rajko earned 300 total points
ID: 6995658
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY>
<?php
include "database.inc.php";
$sql = "select * from test";
$result = mysql_query($sql,$db);
while($row = mysql_fetch_array($result)){
  $innerHTML .= $row['id']."<br />";
}
?>
<form action="<?php $PHP_SELF?>" name="button">
 <table>
  <tr>
   <td valign="top"><input type="submit" name="button1"></td><td><div id="button1_layer" class="b1"><?php if(isset($button1)): echo $innerHTML; endif;?></div></td>
  </tr>
 </table>
</form>
</BODY>
</HTML>

have fun.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question