Google
  Web www.spinics.net

Re: [Bulk] Fwd: Re: [PHP-WIN] Error: Not a proper resource --- with code this time!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]




At 08:06 PM 1/16/2011, Bill Mudry wrote:

X-Apparently-To: billmudry@xxxxxxxxxx via 206.190.37.191; Sun, 16 Jan 2011 12:58:19 -0800
X-YMailISG: 6IyfGVwcZAolrREihPxcaZJx7VkI8KmrvpK2cIzILvqDHzS9
 bpXFKEo3ttD4ShKY2q6wz7M0VD_W49UPhTUK9PtkwCIAoL8yYDmvz3WvA_QY
 uOtcL.0r0GVnnPY._MM44NpRinL61N39mZSyA0vyshF8Ml3jRYONWZ2x1_Qv
 e_y5M9wTeC8HMX0_JN0OU1MWHlOVEe7HfGH3jX283jLJjIaJpnF4K8w_6pEv
 5VPFpnUApcMoJlVkd92cdxkleEaNM.iFDRcc_Xn._Lc0i5god7QPHyu6uaZv
 PPrUFvh9i5FrxBJa8lrcyulkQU8XQwGsVfwwhdhJkzoqooItclhZGWQQSGqL
 9jyKDoN17p00geBpvPunM_NQlChoVEUg0CRIKRPaLPQr8fN3jQriXY33fkub
 KXJmPnWX6kaQS.22Bmopjz6XbsUZkfKUjXv4iqe3a0q8UnVlGo.ugacfUMKL
 TtzBHultKdb5aqhYMjE4JLncD708D41jhKkuixqgxqDyXaUFyJzQlNR4UUvt
 0ITdpjB2Ll1iKtsj1JT6lEv8ExFp._pCu8ayDSOlh8UsUElM6nK9xE.QDalN
 CS6IRWAsQW2JyARyw1UuvhXMFU_FAdd6.NWLUnIxsmF7POVqsw--
X-Originating-IP: [76.75.200.58]
Authentication-Results: mta1001.rog.mail.sp1.yahoo.com from=yahoo.de; domainkeys=neutral (no sig); from=yahoo.de; dkim=permerror (bad sig)
X-Host-Fingerprint: 76.75.200.58 pb1.pair.com
Mailing-List: contact php-windows-help@xxxxxxxxxxxxx; run by ezmlm
list-help: < mailto:php-windows-help@xxxxxxxxxxxxx>
list-unsubscribe: < mailto:php-windows-unsubscribe@xxxxxxxxxxxxx>
list-post: < mailto:php-windows@xxxxxxxxxxxxx>
List-Id: php-windows.lists.php.net
Delivered-To: mailing list php-windows@xxxxxxxxxxxxx
Authentication-Results: pb1.pair.com smtp.mail=cobinja@xxxxxxxx; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=cobinja@xxxxxxxx; sender-id=unknown
X-PHP-List-Original-Sender: cobinja@xxxxxxxx
X-Host-Fingerprint: 98.139.212.172 nm13.bullet.mail.bf1.yahoo.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s1024; t=1295211472; bh=IdykF5YjKiZoaZrGPumJHpZInxsOj9nKmMzsStMHx24=; h=X-Yahoo-Newman-Id:Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=N4QXKF5e6uhF/LfR6x8MmEGtcOvSyQf1DYSbf+qIBiyZ+JcyHvobKSh8LjR5WPwwHuXUCgLelDgeNWV86aaoUDC6FzZkS+Co+pZi7NnP+oqyUx3TcW1Q0J29IVw3N5xNjkDxvwDAQSRKYDi2bbGNzH5r0IyFKH5Bkvu8os4KlNA=
X-Yahoo-Newman-Id: 619138.57359.bm@xxxxxxxxxxxxxxxxxxxxxxxxxx
X-Yahoo-SMTP: wQb7PoiswBDDIaOUwhs3y1Z7sRE-
X-YMail-OSG: _UA5GdwVM1mpaMDCk1V7eKI9qRSVFoUCGQ3PYinwqJpthdU
 Yp7FqAy0KTHGLAFFLh1YHuUJinBVeLwGhU_xJdgH9uN3ifKJwZxXHyt8in8j
 VGyZ3Z2V66NmS.kpx_6r7nYe3.CNn8EI4gcIjR6gx_i2VXqZmr3URoQ.fTmM
 6jv.5.d7_ntKTC46H9hgCtn6VvcEVJyW6B37gDNf1kYxmsTGUR6_SbEZ_Wfs
 -
Date: Sun, 16 Jan 2011 21:57:47 +0100
From: Lars Mueller <cobinja@xxxxxxxx>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2.13) Gecko/20101207 Lightning/1.0b2 Thunderbird/3.1.7
To: php-windows@xxxxxxxxxxxxx
Subject: Re:  Error: Not a proper resource --- with code this time!

Am 15.01.2011 17:35, schrieb Bill Mudry:

Lars, thank you for your effort and willingness to help. Unfortunately,
we have a way to go yet for success:



$uvquery = "SELECT `uv_filename` FROM 'uvphotos' WHERE `species_name`=
$speciesname";

That should probably be
... FROM `uvphotos` WHERE `species_name` = '$speciesname'";

When I substituted this suggestion I got the following error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''uvphotos' WHERE `species_name` = ''' at line 1


or better:
...WHERE `species_name` = '".mysql_real_escape($speciesname)."'";

When I tried this, I found more information on mysql_real_escape() at:
        http://php.net/manual/en/function.mysql-real-escape-string.php
With this proof that it is a valid function, it is hard to understand the
error I got when I used your second suggestion. I was surprising:

Fatal error: Call to undefined function mysql_real_escape() in /home/content/b/i/l/billmudry/html/taxa/show_uv_photos.php on line 69

Sooo ..... I will wish you and anyone else the best but we are not at a working solution yet.

I was thinking of listing only the section of interest but just to be on the safe
if not complete side, I will list below the full page code as it stands.

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

[CODE]
<?php
////////////////////////////////////////////////////////////////////////////////////////////////////////
//  Program: show_uv_photos.php
// Description: This program displays Uv fluorescence photos of wood found to glow under an ultraviolet
//  light. This is around 10% - 15% of all wood species.
//
// It runs as a pop-up window and is activated by a button titled "U.V. Fluorescence" generated by // displayspecies.php. Future code may be added later to display the buttons only if the program can
//  detect UV photos stored for each species.
//  PARAMETERS:
// {$_SESSION["speciesname"]} - Looks back to find what the current species picked is. // speciesname - The session variable name for the cuurent species. // $speciesname - The standard variable name taken from the session variable. // species_name - the name of the column that stores up to over 15,000 different botanical naes of wood. // uvphotos - the name of the table in the TAXA database that holds the partial path and photo file
//                      name
////////////////////////////////////////////////////////////////////////////////////////////////////////
session_start();

//ECHO "Session variable for species name is - {$_SESSION['species_name']}"; //Debug statement
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd";>
<HTML>
<head>
<title>TAXA: Ultraviolet Wood Fluorescence</title>


</head>

<body bgcolor='ivory'>

<?PHP

# ////////////////////////////////////////////////////////////////////////////////////
#                                           CONNECT TO DATABASE
# ////////////////////////////////////////////////////////////////////////////////////



include ("connecttotaxa.php");
$connection = mysql_connect($hostname, $username, $password)
        or die("Unable to connect to database server");

$dbname="taxa";
$db = mysql_select_db($dbname, $connection)
        or die("Unable to connect to database");
/*
--------------------------------------------------------------------------------
                                            HOPEFULLY CONNECTED AT THIS POINT
----------------------------------------------------------------------------------
*/

///////////////////////////////////////////////////////////////////////////////////////////////////////
// SECTION TO DISPLAY WOOD SCANS
/////////////////////////////////////////////////////////////////////////////////////////////////////

        Echo "<div align = 'center'>";

        Echo "<H2 align=\'center\'>Ultraviolet Fluorescence Photo of
        {$_SESSION["speciesname"]}</H2>";

$speciesname = $_SESSION["speciesname"]; //Successful transfer of ssssion parameter to a variable. //Echo "The species name is - $speciesname<br />"; //Proof that it transferred properly

//$uvquery = "SELECT * FROM uvphotos WHERE 'species_name' = $speciesname";

        $uvquery = "SELECT `uv_filename` FROM 'uvphotos'
        WHERE `species_name` = '$speciesname'";


        //WHERE `species_name` = '".mysql_real_escape($speciesname)."'";
        //WHERE `species_name`= $speciesname";



//$uvquery = "SELECT * FROM `uvphotos` WHERE `species_name` = '{$_SESSION["speciesname"]}' " or die ('Error: '.mysql_error ()); //No error reported.

        $resultuv = mysql_query($uvquery) or die(mysql_error());

        /*
        if(!$resultuv)
                {
                        die(mysql_error())
                };
        */
        //Echo "\$resultuv on line 58 is - $resultuv<br />";

//$number=mysql_num_rows($resultuv); // This and the next line only to debug a warning
        //ECHO "Number of rows is - $number<br >";

        if(mysql_num_rows($uvresults) >0){
                $row = mysql_fetch_array($resultuv);
                extract($row);
        }


        //$uv_filename = row('uv_filename');

        //ECHO "\$uv_filename on line 62 is - $uv_filename<br /><br />";

        //$uvfilename = "uva/acacia_anura-mulgaUV01-800.JPG";
        $uvpath = "./uv/$uvfilename";

        ECHO "<img src='$uvpath'><br />";

        ECHO "<HR>";

  Echo "<br />END OF PICTURE AREA<br /><br />";

Echo "</div>";



?>

<h4 align="center">Webmaster: This function is still Under Construction</h4>



<table align='center' cellpadding='10', Cellspacing='20' border =1>
<tr>
        <td valign='top'>
                <form name='NewWin'>
<p><A href="javascript: self.close ()">Close this Window</A></p>
                </form>
        </td>

</tr
></table>

</body>
</HTML>

[/CODE]
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx



[PHP Home]     [PHP Users]     [PHP Install]     [PHP on Windows]     [Programming PHP]     [Kernel Newbies]     [Rice Cooker]     [Home]     [Yosemite News]     [Yosemite Photos]     [PHP Books]

Powered by Linux