[PHP] Re: Whats wrong with this statement.

2003-12-13 Thread Justin Patrin
Philip J. Newman wrote:


$websiteUrl="http://www.philipnz.com/";;
$websiteEmail="[EMAIL PROTECTED]";
// CHECK TO SEE IF DATA MATCHS WHATS IN THE DATABASE.
 $sql = "SELECT hUrl,hContactEmail FROM hyperlinks_data";
 $sql_result = mysql_query($sql, $connection) or die ("Could not get Query"); 

 $exists_hUrl = "0";
 $exists_hContactEmail = "0";
 
 while ($row = mysql_fetch_array($sql_result))   {

  if ($websiteUrl==$row["hUrl"]) { $exists_hUrl = "1"; break;  }
  if ($websiteEmail==$row["hContactEmail"]) { $exists_hContactEmail = "1";  break;  }
  
 }

  Echo" $exists_hUrl, $exists_hContactEmail";

?>

---
Philip J. Newman
Master Developer
PhilipNZ.com [NZ] Ltd.
[EMAIL PROTECTED]
The "break;" breaks out of the while loop, causing it to skip the second 
check and all remaining records. You should be doing this in the SQL:

SELECT hUrl,hContactEmail FROM hyperlinks_data WHERE hUrl = 
"$websiteUrl" and hContactEmail = "$websiteEmail";

--
paperCrane 
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: whats wrong with this?

2002-08-30 Thread Richard Lynch

> if($day = $system_day){
>
>the problem i am experiencing is that it seems the "if" statement is setting
>the $day value to equal $system_day instead of comparing their values
>if i add

That's because you have only one = sign there.

= by itself does the assignment (setting a value)
== does comparison.

Sometimes, you do *both* an assignment and "test" the "answer" in a single
line like this:

if ($row = mysql_fetch_row($result)){

Here, the = does an "assignment" (sets the value) and then the *VALUE* is
tested to see if there is something there or not.

The = sign is only roughly similar to = in Mathematics.

Or, perhaps it would be better to say that:

= is like "Suppose x = 5.  Then..."
== is like "Is x = 5?"

-- 
Like Music?  http://l-i-e.com/artists.htm


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Whats wrong with getimagesize ??

2002-03-19 Thread andy

hi.. foud the error. For everybody who might cope with the same error:

the prob was that getimagesize requires a path name without protocol like:
/pictures/12.gif

http://server.com/pictures/12.gif does not work with htaccess and imagesize

Thats it. easy hah :-)

Andy

"Andy" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi guys,
>
> I am really stuck with this prob. Anyhow php can't read imagefiles after
> password protecting the site with htaccess. The file exists, the
application
> works (after deleting the htaccess function), the path is ok. copy and
> pasting the url into the browserwindow returns the image. So whats wrong??
>
> I am getting following erromsg:
>
> Warning: getimagesize: Unable to open
>
'http://testserver/subapp_gallery/app_data/ca/pictures/www.globosapiens.net-
> -canada--northwest-territories--id=239.jpg' for reading
>
> does anybody have any idea? I would really apreciate it, this gives me a
> real headache.
>
> Thanx for any help,
>
> Andy
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: whats wrong?

2001-08-01 Thread Richard Lynch

> 
> ">

You are using the "short open tag" of http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: whats wrong?

2001-07-31 Thread Philip Olson

Read this :

  Using Strings   :
  -
  http://www.zend.com/zend/tut/using-strings.php

Notice :

  echo "This will give a "parse error" to us";
  echo "This will not give a \"parse error\" to us";
  echo "This won't either";
  echo 'But 'this' will';
  echo 'But this won\'t';

Besides, one doesn't need quotes to echo a variable.

Regards,
Philip


Jeremy Morano wrote:

> Anythig visibly wrong with this?
> 
> 
> 
> ">



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]