hi people I trying to join the 2 report1 and report2 together to send it to the actionscript for displaying the result how do I join them together plss help below is my code:
[PHP]
<?php
$temp="";
$sqlconnect=mysql_connect("localhost","hyperian_tr ack","gsmtrack");
if(!$sqlconnect)
die(mysql_error());
mysql_select_db("hyperian_track", $sqlconnect);
if($_POST['postal']))
$postalcode=substr($_POST['postal'],0,2); //will return from 0 position 2 characters
$resultpostal=mysql_query("SELECT startlat,endlat,startlng,endlng FROM districts
WHERE districtno = $postalcode"); //get startlat,endlat,startlng,endlng of location
while($row = mysql_fetch_array($resultpostal))
{
$temp[]=$row; // store each record in an array
}
foreach($temp as $key=>$extract)
$report=$report.$key."=".$extract."&";
echo '&report=1&';
$resultname=mysql_query("SELECT uname FROM location,districts
WHERE location.lat < districts.startlat AND location.lat > districts.endlat AND location.lng < districts.startlng
AND location.lng > districts.endlng");
while($row = mysql_fetch_array($resultname))
{
$temp[]=$row;
}
foreach($temp as $key=>$extract)
$report=$report.$key."=".$extract."&";
echo '&report=2&';
}//end of if loops
mysql_close($con);
[/PHP]
Instead of echo '&report=1&'; And echo '&report=2&'; seperately how do I combine them together and echo it to actionscript?
4 1338
hi people I trying to join the 2 report1 and report2 together to send it to the actionscript for displaying the result how do I join them together plss help below is my code:
[PHP]
<?php
$temp="";
$sqlconnect=mysql_connect("localhost","hyperian_tr ack","gsmtrack");
if(!$sqlconnect)
die(mysql_error());
mysql_select_db("hyperian_track", $sqlconnect);
if($_POST['postal']))
$postalcode=substr($_POST['postal'],0,2); //will return from 0 position 2 characters
$resultpostal=mysql_query("SELECT startlat,endlat,startlng,endlng FROM districts
WHERE districtno = $postalcode"); //get startlat,endlat,startlng,endlng of location
while($row = mysql_fetch_array($resultpostal))
{
$temp[]=$row; // store each record in an array
}
foreach($temp as $key=>$extract)
$report=$report.$key."=".$extract."&";
echo '&report=1&';
$resultname=mysql_query("SELECT uname FROM location,districts
WHERE location.lat < districts.startlat AND location.lat > districts.endlat AND location.lng < districts.startlng
AND location.lng > districts.endlng");
while($row = mysql_fetch_array($resultname))
{
$temp[]=$row;
}
foreach($temp as $key=>$extract)
$report=$report.$key."=".$extract."&";
echo '&report=2&';
}//end of if loops
mysql_close($con);
[/PHP]
Instead of echo '&report=1&'; And echo '&report=2&'; seperately how do I combine them together and echo it to actionscript?
You can store them first in a variable and concatenate by using the dot operator..
For example $x=$report1.$report2;
You can store them first in a variable and concatenate by using the dot operator..
For example $x=$report1.$report2;
hi how do I do it can show me example?
just curious what is this part of the code doing?
[PHP]
while($row = mysql_fetch_array($resultpostal))
{
$temp[]=$row; // store each record in an array
}
foreach($temp as $key=>$extract)
$report=$report.$key."=".$extract."&";
echo '&report=1&';
[/PHP]
just curious what is this part of the code doing?
[PHP]
while($row = mysql_fetch_array($resultpostal))
{
$temp[]=$row; // store each record in an array
}
foreach($temp as $key=>$extract)
$report=$report.$key."=".$extract."&";
echo '&report=1&';
[/PHP]
I think there is an error in your code....
The code above displays this
&report=1& in the browser....
Try to replace it with: echo $report; -
while($row = mysql_fetch_array($resultpostal))
-
{
-
$temp[]=$row; // store each record in an array
-
}
-
As you can see the code extracts the record in the database and store it in a array $temp[] -
-
foreach($temp as $key=>$extract)
-
$report=$report.$key."=".$extract."&";
-
The code above allows you to retrieve the items in the $temp array and store it in the $report variable by concatenating it.
Hope you find your way through it..
Cheers
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Phil Powell |
last post by:
I'm not kidding, the only reason yesterday you didn't hear from me was
because I wasn't coding, but today I am doing something quick, and yes, as
always it failed.. right at the SQL statement:
...
|
by: Paul Bramscher |
last post by:
Here's one for pathological SQL programmers.
I've got a table of things called elements. They're components, sort of
like amino acids, which come together to form complex web pages -- as
nodes...
|
by: kieran |
last post by:
Hi,
I have the following SQL statement which is pulling a few details from
a database. As you can see, there is only the one table from which i
am creating a temporary copy.
The reason I do...
|
by: Thomas Beutin |
last post by:
Hi,
i've a speed problem withe the following statement:
SELECT DISTINCT pz.l1_id, pz.l2_id, pz.l3_id, pz.l4_id
FROM ot_adresse AS a, ot_produkt AS p
LEFT OUTER JOIN ot_kat_prod AS pz ON (...
|
by: stabbert |
last post by:
I am attempting to join two tables together on two different unix
servers. Here is some relevant info about the tables.
TABLE 1 Setup
-----------------------
DB2 UDB 7.2 EE
|
by: Elizabeth Harmon |
last post by:
Hi All
I am just double checking myself here.
I have two threads that i am running in an application, One Thread Updates a
client side Table in a local DB, another Updates a Server Side Table...
|
by: gimme_this_gimme_that |
last post by:
I have an employee table with two columns, one named login, the other
named otherdata.
I have a list of login values, some of which do not exist in the
employee table.
I want to fetch the...
|
by: MP |
last post by:
Hi
trying to begin to learn database using vb6, ado/adox, mdb format, sql
(not using access...just mdb format via ado)
i need to group the values of multiple fields
- get their possible...
|
by: Paulo da Silva |
last post by:
Hi!
I was told in this NG that string is obsolet. I should use
str methods.
So, how do I join a list of strings delimited by a given
char, let's say ','?
Old way:
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |