Solved

position x  position y   (positioning myself for echo)

Posted on 2002-05-04
4
192 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
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 100 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

813 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now