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
Solved

position x  position y   (positioning myself for echo)

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
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 …

791 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