473,385 Members | 2,005 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to use image definition in SQL query?

hi,

please i need some help;


i have a "for" function that create for each ip address found in the database an image button having a name="the ip address". this is the code:

<?php
$query = mysql_query("SELECT * FROM site_status");
$number= mysql_num_rows($query);

for ($i=0; $i<$number; $i++){
$row[$i] = mysql_fetch_assoc($query);
?>

in HTML :

<input type="image" src="./images/bat.png" border="0" alt="<?php echo $row[$i]["CSTip"];?>" name="<?php echo $row[$i]["CSTip"];?>" width="80" height="90" onClick="window.open('real_time_graph-v1.php','Quality_Graph','width=1000,height=500,res izable=yes,scrollbars=yes')" />


when i click on an image; i ll redirect to the file
real_time_graph-v1.php where i have an SQL query:

$voltage_query = "SELECT volt FROM volt_table where CSTip='%NAME_VALUE%'and date='%CSXdate%'";


the NAME_VALUE should be the name of the image where i clicked(or any identity of the clicked image)

i dont know how to write this :( !!!!
Dec 8 '10 #1
1 1970
johny10151981
1,059 1GB
Expand|Select|Wrap|Line Numbers
  1. window.open('real_time_graph-v1.php?CSTip=<?=$row[$i]["CSTip"]?>','Quality_Graph','width=1000,height=500,res izable=yes,scrollbars=yes')
  2.  
please encode $row[$i]["CSTip"] properly

and in real_time_graph-v1.php file add the below code

Expand|Select|Wrap|Line Numbers
  1.  if(isset($_GET['CSTip'])==fase)
  2.  {
  3.   echo "Unexpected access";
  4.   exit;
  5.  }
  6.  
  7. $CSTip=$_GET['CSTip'];
  8. $voltage_query = "SELECT volt FROM volt_table where CSTip='%".$CSTip."%'and date='%CSXdate%'";
  9.  
Dec 9 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Beowulf | last post by:
Hi Guru's, I have a query regarding using PHP to maintain a user profiles list. I want to be able to have a form where users can fill in their profile info (Name, hobbies etc) and attach an...
6
by: Access Newbie | last post by:
I'm using Access 2000 and I'm trying to create a pass-through query to append all the data from a local table to a remote table. I'm using the SQL query editor in MS Access to create the query (I...
0
by: elie chucrallah | last post by:
Dear Sirs, I have the following select query and i need to update the field EmailLastReceivedDate (showing null in the select) to the values in the field MaxOfSentOn using access 2000 query ...
2
by: Vitalii | last post by:
Hi I am using Image control with DataList control but have a problem. Here is the code I am using <asp:Image ImageURL='<%# DataBinder.Eval(Container.DataItem, "imagefilename" ) %>'...
6
by: Peter Herath | last post by:
I want to create a dynamic report using a crosstab query...... pls someone look into my attached example database and help me out to do the report generation.... example is like dis...: there...
0
by: veenala | last post by:
Hi, Iam using image type input button in an application: <form> <input type = "image" id = "back" name= "back" alt = "back" src = "graphics\back.png" > </form> While checking for...
3
by: prabhas | last post by:
I want to swap two tuples in a table, using a single , simple query. No SELECT query allowed, no inner queries allowed. No PL/SQL allowed. Do you have any idea how to do this? e.g. my current...
1
by: jaceyk | last post by:
Is it even remotely possible to update field names to the correct field name for the same table using a data definition query? We have a utility that spits out data in an Access database for use in...
1
by: dipalipatel | last post by:
Hi, I need help to show Image on MS Access form using image control. i am using Memo field to store my image bytes, Data E.g. order# Number 1001 ...
1
by: shoaib kahn | last post by:
i am developing a web site in Asp.Net using Visual Studio 2008. i want to know that how can i search a keyword that will be entered by the user, i want the key word should be searched in complete...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.