Jump to content


  • Posts

  • Joined

  • Last visited


Profile Information

  • Gender
    Not Telling

gnuffo1's Achievements


Newbie (1/5)



  1. Hi, I've never used Doctrine before, so I decided to try out Doctrine 2 and went to this tutorial, which seems to be the one for starting out: http://www.doctrine-project.org/projects/orm/2.0/docs/cookbook/getting-started-xml-edition/en At the stage "Generating the Database Schema" however, when running the doctrine tool on the command line I am getting the fatal error: Failed opening required 'Doctrine\Common\Cli\Configuration.php'. Looking at the sample cli-config.php code, this seems to be because the class in question does not exist anywhere within the Doctrine library. Any ideas on how to get this working? The code: $cliConfig = new Doctrine\Common\Cli\Configuration(); $cliConfig->setAttribute('em', $entityManager);
  2. This site [a href=\"http://api.hostip.info/?ip=\" target=\"_blank\"]http://api.hostip.info/?ip=[/a][ip address] produces an xml document giving details about the IP address, including the country. So it would probably be quite easy to write a function that gets the country code from there based on $_SERVER['REMOTE_ADDR']
  3. I don't know if & works in JS, but &038; definitly does and my page validates with it.
  4. My loop gets a list of URLs in my DB and scans those URLs using fopen (the reason is to scan my supplier's site to update prices). It consists of a while loop to get all of the URLs from each record and then update them one by one. The problem is that some of the URL's link to pages that aren't on the site anymore and I don't have the time to go round checking them all. When the loop comes to one of the invalid URLs, the script stops processing all the other records and I just get errors about it not being a valid resource for fopen. So is there a function to check this, where it only actually does open the page if it is valid; hopefully this will avoid the errors and not stop the script. Thanks
  5. The website in planning will have a system for rating and writing reviews on products. Since there will be a lot users that will leave the review field blank, which of these designs is the best: 1. Have two seperate review and ratings tables and when a user does fill out both a one to one relationship between the two records is established. That way records in the review table (or even the rating table is user only write reviews and don't rate) will only be created when there is actually a review. 2. Have one table that contains a review field and the ratings fields. This version will have a lot of NULL (empty) fields, but should be quicker. Note that the ratings and the reviews are both for the product, the ratings are not ratings of the review or vice versa.
  6. I've fixed it. The problem was that $stocklevel actually contained some html code in it as well, since I scanned it from an external website, but I put the substr bit to remove that code in the wrong if statement and hence it was trying to insert text into a int field; the error was displaying the text in the browser, but because it was mainly html tags the browser didn't output them to the screen so I didn't notice.
  7. No, just got rid of the die bit off the end of the the stock update and it still doesn't work. I don't get any errors displayed and the page appears to work, displays the right amount (this is without the ' around $stocklevel) but when I check the database it just doesn't want to update. I've even put curly braces around each query, so: [code]{ $updateprice = "UPDATE products SET products_price=$price WHERE products_id=$products_id"; $result = mysql_query($updateprice) or die ('Your price query doesn't work: ' . mysql_error()); } { $updatestock = "UPDATE products SET products_quantity=$stocklevel WHERE products_id=$products_id"; $result = mysql_query($updatestock); }[/code] but to no avial. And just in case you noticed the ' in doesn't for the error messege - that's not what's really in the error messege in the code, I actually have some swear words in it because I'm so annoyed and forgot that you can't have ' unless you \ them when I was censoring, but I digress.
  8. I have the variable stocklevel, which when echoed displays the correct amount, but after I do this query: [code]$updatestock = "UPDATE products SET products_quantity='$stocklevel' WHERE  products_id=$products_id"; $result = mysql_query($updatestock) or die ('Your stock query doesn't work: ' . mysql_error());[/code] The php page it's in appears to load fine, doesn't even have any errors, but the field in the DB is ALWAYS updated to 0, no matter what the $stocklevel contains, even though it echos a completely different value on the page. I did have the same query before, but without the ' marks around $stocklevel and that displayed the error saying there was incorrect syntax near '=73' (if 73 was $stocklevel) What I especially don't get is that just above that query in the php code, I have this one for updating the price, which works absoloutley fine and is in EXACTLY the same format: [code]$updateprice = "UPDATE products SET products_price=$price WHERE products_id=$products_id"; $result = mysql_query($updateprice) or die ('Your price query doesn't work: ' . mysql_error());[/code] This one works absoloutley fine all the time, even when I was getting an error messege for the stock one when I didn't have the ' marks around $stocklevel, and as you can see is in exactly the same format as the stock one. I don't understand it at all. Another weird thing is the stock update query was working fine until I stuck the "or die" bit on the end. Ironically, maybe the error message is causing the problem?
  9. [!--quoteo(post=341978:date=Feb 2 2006, 04:04 AM:name=fenway)--][div class=\'quotetop\']QUOTE(fenway @ Feb 2 2006, 04:04 AM) 341978[/snapback][/div][div class=\'quotemain\'][!--quotec--] No offence, but PHPMyAdmin totally sucks if you want to edit 3 rows at a time without having to click a thousand times. It's fine for raw queries, of course, but if you want to do anything meaningful with a result set, you're out of luck. I do have phpmyadmin on my host, and this is exactly why I hate it. It's just too slow. I've tried all those ones that have been suggested, as well as another I got suggested to me - SQL manager, which seems to be the best out of all that I have seen, although none of what I have tried allow me to copy a whole column of fields from excel - but Navicat has an export feature to csv which would help; that seems to only be available on the registered version, so I might try buying it. Thanks for the suggestions
  10. Preferably free. I did try MySQL administrator made by MySQL AB, but as far as I could see, it was mainly for monitoring the database and not editing records. Thanks
  • 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.