Jump to content

richardstan

Members
  • Posts

    16
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

richardstan's Achievements

Member

Member (2/5)

0

Reputation

  1. I have two tables, representing two different shops that have a list of stock. Both shops sell milk, but at different prices. How can I use mysql to compare the values in the two different tables and return the lowest one for the price of milk? Thanks.
  2. Ok i solved this problem with APACHE CRASHING when calling PHP MySQL functions. Make sure "libmysql.dll" is somewhere that can be seen by Apache. Copy it out of your PHP directory and into the same directory as Apache. Hope this helps anyone that comes across this thread. Thanks Richard.
  3. I've done this and there is no effect on the running it still crashes Apache. Do you think this could be a bug with the latest release? Richard.
  4. Hi. I have installed Apache 2.2, PHP 5.2.10 and MySQL 5.1 installed on a Vista Home Premium PC. I have uncommented php_mysql.dll in the php.ini file and set the extension_dir to an absolute path instead of a relative "./ext" because apache was throwing up errors before hand about not being able to load the module. When i try to run a mysql command such as mysql_connect, the web page takes several seconds to load, then comes up with an internet explorer cannot show this page error. Apache then crashes. The apache error log shows: Parent: child process exited with status 255 -- Restarting. There is obviously a prolem with the mysql module somewhere in php but i cant figure out what it is Can someone please help me! Thanks Richard.
  5. Hi, how can i get php to litteraly print a tag so that it is not interpretted by the Browser as an HTML Tag. For example, when you look at an XML document in a browser it shows <root> <tag1> </tag1> <tag2> </tag2> </root> if i try and use echo '<tag>' then my browser will try and interpret this as HTML or do something weird instead of litterally printing <tag>. Does this make sense? Thanks Richard.
  6. I have made sure the curl extension is unchecked in the php.ini file and am using the following code <?php if(!($curl = curl_init())){ print("Unable to initialise CURl resource!"); exit(); } //configure for a post requst to php.net's search engine curl_setopt($curl, CURLOPT_URL, 'http://www.php.net/search.php'); curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($curl, CURLOPT_POST, TRUE); curl_setopt($curl, CURLOPT_POSTFIELDS, 'lang=en_US&pattern=Zend API&show=nosource'); //make request $results = curl_exec($curl); print("<pre>"); print(htmlentities($results)); print("</pre>"); ?> When i run the page, all i get is a blank page instead of the webpage that should be printed out.Does anyone know why this wont work? I don't think this is a fatal error as i dont get a HTTP 500 response inside Internet Explorer. Thanks Richard.
  7. Hi, ive created an XSL Style sheet which will be associated with an XML document using the following code: $path_xml = "freedomland.xml"; $path_style = "forest.xsl"; $xml_obj = new DomDocument; $xsl_obj = new DomDocument; if(!$xml_obj->load($path_xml)){ echo "Error! Unable to open " . $path_xml. "!\n"; exit; } if(!$xsl_obj->load($path_style)){ echo "Error! Unable to open ". $path_style . "!\n"; exit; } $xslt_parse = new xsltprocessor; $xslt_parse->importStyleSheet($xsl_obj); echo $xslt_parse->transformToXML($xml_obj); however, when i try to run this PHP file, i get an error saying that the program was unable to open forest.xsl ( the name of my xsl file). The file definately exists and the code is written correctly. Windows also throws a similar error when i'm trying to load the file from Windows Explorer, "Window Cannot find 'forest.xsl'. Make sure you typed the name correctly, and then try again." but the file content will still load into Dreamweaver. Are the errorrs in my script and the Windows Explorer error in any way related? Thanks Richard.
  8. Hi, i have a mysql table with the following columns id, title, description, name, location. when i'm using the insert statement, do i need to put a value in for the ID field if i have set it to INT NOT NULL AUTO_INCREMENT? for example, is the right code? INSERT INTO LISTINGS(ID, TITLE, DESCRIPTION, NAME, LOCATION) VALUES (1, JUG, 2000 YEARS OLD, RICHARD, KENT) or INSERT INTO LISTINGS(TITLE, DESCRIPTION, NAME, LOCATION) VALUES (JUG, 2000 YEARS OLD, RICHARD, KENT) thanks richard.
  9. Hi, i have the following code: print "<FORM align=\"Center\" action=\"<?php echo $PHP_SELF ?>\" method=\"GET\">"; print "<Button name=\"Button\" value=\"".$file."\">".$file."</button>"; print "</FORM>"; print $PHP_SELF; Once i have clicked the button created by the script, the URL i see in the address bar comes up as http://blackberrymap.awardspace.com/PHP/%3C?Button=Program.java The PHP script is called Manager.php and print $PHP_SELF comes up as /PHP/Manager.php There is further code in Manager which deals with the variables shown the URL, but this doesn't work at the moment because instead of appending "/PHP/Manager.php?Button=Program.java" to the URL, it appends, %3C?Button=Program.java Can someone tell me why this is happening? Thanks Richard.
  10. I am using file_get_contents() to return the contents of a php File. In another php file i am printing this contents, however, instead of priting just a string, the PHP inteprets it as PHP commands and renders it as if it were interpreting the commands of a real PHP file. How can i convert the $file contents into a String which prints as a String? Thanks Richard.
  11. Hi, I have the following function in a file called SQL.php: function connectDatabase($hostname, $user, $pass){ $link = @mysql_connect($hostname, $user, $pass); if(!$link){ print "<br>Failed to Connect to SQL Server"; } else{ print "<br>Connected to SQL Server"; } return $link; } Another file calls this function after using include("SQL.php"). However, there is no message saying whether the connection was successful or not. $hostname = "localhost"; $user = "****"; $pass = "****"; $link = connectDatabase($hostname, $user, $pass); I know that the SQL.php file is working fine because I have made it so a message comes up when there are no code errors. Can someone tell me why this might happen? Thanks Richard.
  12. Hi i have the following script: <html> <body> <?php $imageURL; $imageHeight; $imageWidth; $URL = "http://localhost/thumbnails/thumbs.php?image=".$imageURL."&height=".$imageHeight."&width=".$imageWidth; <form action="<?php print URL?>" method="GET"> <input type="text" name= How can i set the form so that it sets the values of $imageURL, $imageHeight and $imageWidth using the text written in the form, then follows the action already defined at the top of the form to forward onto the $URL i have used? Thanks Richard.
  13. Is there any way to print a list of functions that a PHP file contains from inside a php script? Thanks Richard.
  14. Hi, I want to be able to construct and use the methods of a class in one php file from another php file. For example Database.php class MySQL{ function connect($hostname,$pass,$user) { return $link; } function disconnect($link) {} } then use these methods in another php form. How do i go about doing this? Thanks Richard.
  15. Hi, I want to be able to create a class in one PHP file with some methods which i can then reference from another PHP file. For example, Database.php class MySQL{ function
×
×
  • 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.