Jump to content

[SOLVED] echo problem.


jmac2501

Recommended Posts

Sorry for starting a new thread bout the same thing but i simplified my script to see if i could get an answer easier this way.

 

I am pulling info from a field in my database called "reo" I need to echo this results into a http string but i am having no luck. I have marked in red the $reo that i need echoed

<?php
error_reporting(E_ALL ^ E_NOTICE);

$link = mysql_connect('mysql6.*****.com', '******', '*****')
    or die('Could not connect: ' . mysql_error());
mysql_select_db('dcremax') or die('Could not select database');
$query="SELECT * FROM Listings";
$result=mysql_query($query);

$num=mysql_numrows($result);

mysql_close();


$i=0;
while ($i < $num) {

[color=red]$reo[/color]=mysql_result($result,$i,"reo");

require_once("class_http.php");

$h = new http();

$h->dir = "/home/foo/bar/"; 

if (!$h->fetch("http://metrolistmls.com/cgi-bin/GetOneR.cfm?County=SA&iRow=0&nJL=7&MLSNum=[color=red]$reo[/color];")) {

  echo "<h2>There is a problem with the http request!</h2>";
  echo $h->log;
  exit();
}

if($beg = strpos($h->body, "http://mlsmedia.metrolistmls.com/bigphoto/", 0 ))
{$end = strpos($h->body, ".jpg", $beg );
$pic = substr($h->body, $beg, ($end + 4) - $beg );
echo("$pic");
echo("<br />");
}

$i++;
}

?>

 

If i manuly add the "reo" info it works fine. but if i try to use the $reo query it times out. Any helf would be great.

 

Thanks

Link to comment
Share on other sites

ok so i did that and I don't get that error anymore. So I guess my question is How do i echo $reo=mysql_result($result,$i,"reo"); into here

 

if (!$h->fetch("http://metrolistmls.com/cgi-bin/GetOneR.cfm?County=SA&iRow=0&nJL=7&MLSNum=$reo;")) {

 

 

 

 

ya do it like this

 

if (!$h->fetch("http://metrolistmls.com/cgi-bin/GetOneR.cfm?County=SA&iRow=0&nJL=7&MLSNum=".$reo)) {

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.