Stuffing a paragraph of text into mySQL ????

From: Date: Fri, 08 Sep 2000 05:11:45 +0000
Subject: Stuffing a paragraph of text into mySQL ????
Groups: php.db 
Request: Send a blank email to php-db+get-2730@lists.php.net to get a copy of this message
I want to create a database for recipes (so my wife will cook!) but I am having trouble with my SQL. My Question: 1) I used field type "text" for paragraph type data such as description and directions. Was that field tpe correct choice? If not, what type? My system is a Windows 2k with Apache 1.3.12, mySQL 3.23.? and PHP4. My DB table is like this: Field Type Null Key Default ----- ---- ---- --- ------- rid int(11) PRI auto_increment title varchar(255) YES NULL ingredients text YES NULL directions text YES NULL description text YES NULL keywords varchar(128) YES NULL My SQL looks like this: insert into recipe (title,ingredients,directions,description,keywords) values ($rtitle,$ingredients,$directions,$description,$keywords) Here is the Error Message: Error Message: You have an error in your SQL syntax near 'cup orange juice 1 cup water 1/4 cup egg substitute 3/4 teaspoo' at line 1 Here is my recipe text: Orange Julius Description: Here's a quick-n-easy recipe from the first Top Secret Recipes book. Notice the egg substitute (which is made from egg whites) in the recipe. That's how you get a frothy, foamy drink. If you want a version of Strawberry and Pineapple Julius, check out the recipes in the second book, More Top Secret Recipes. Ingredients: 1 cup orange juice 1 cup water 1/4 cup egg substitute 3/4 teaspoon vanilla extract 1/4 cup sugar 1 heaping cup ice Directions: Combine all of the ingredients in a blender set on high speed for 15-30 seconds. (http://www.topsecretrecipes.com) Makes 2 drinks. The original recipe here and in the books includes real egg white, but, after many suggestions from readers I have replaced that with 1/4 cup egg substitute, which is mostly egg white and does a great job of making the drink foamy. If you like, you can instead use 2 tablespoons of the drink foam product Frothee. This is available in many supermarket liquor sections or in liquor stores. Or, if it\'s all you\'ve got available, you can still use 1 egg white from a large egg as originally specified in the recipe.

« previous php.db (#2730) next »