Jump to content

outofthisworldpc

Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

outofthisworldpc's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. No the table is not made from this script as it shows that error posted above regarding line 23. There will be multiple users who will be using this query form which is the reason I'm going this route. Tks, Brad.
  2. Hello, I'm attempting to run this PHP script that'll create a table of data in a MySQL database. I can't use the VARCHARS option for most of the fields as there will be a lot of content written in the areas that read "TEXT". I'm too sure how to fix this script so it creates the SQL table properly so any help will be appreciated. When i run this as index.php on my server, an error comes up saying: [i]"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 '' at line 23"[/i] I checked line 23 but am uncertain on what the issue is. The Script is below: [quote] <?php $db_host = "localhost"; $db_user = "mypal"; $db_pwd = "ezine"; $db_name = "users"; mysql_connect($db_host, $db_user, $db_pwd); mysql_select_db($db_name); mysql_query('CREATE TABLE sections( logo VARCHAR(100), contact VARCHAR(100), themeHeader VARCHAR(100), lifeSolutionsArticle TEXT, lifeSolutionsAuthor TEXT, workSolutionsArticle TEXT, workSolutionsAuthor TEXT, featureArticle TEXT, featureAuthor TEXT, highlyRecommendedContent TEXT, todaysActionContent TEXT, lifeSolutionsContent TEXT, lifeSolutionsAdtrack TEXT, adSlot1 TEXT, workSolutionsContent TEXT,        <---- Line 23 workSolutionsAdtrack TEXT, adSlot1 TEXT, featureContent TEXT, featureAdtrack TEXT, adSlot3 TEXT, lighterSideContent TEXT, copyrightContent TEXT') or die(mysql_error()); echo "Table created!"; ?> <html> <head> <title>Ezine Control Panel</title> <style type="text/css"> <!-- .style1 { font-size: 12px; font-style: italic; } .style3 {font-size: 12px; font-weight: bold; } .style5 {font-size: 12px; font-weight: bold; font-style: italic; } --> </style> </head> <body> <?php if (!isset($_POST['submit'])) { ?> <form action="" method="post">   <div align="center">     <p><img src="../MyPal2_header.gif" width="620" height="94"></p>     <p><strong>E-ZINE TEMPLATE WIZARD CONTROL PANEL</strong></p>     <p><span class="style3">*Note: All text areas below are HTML enabled.* </span><br>     </p>     <p>       Insert Logo HTML here: <br>       <span class="style1">(Example: &lt;img src=&quot;http://www.sample.com/logo.jpg&quot;&gt;) </span><br>       <input name="logo" type="text" id="logo" value="" size="50">     </p>     <p>Contact Information:<br>       <input name="contact" type="text" value="" size="50">       <br>       <br>       <strong>TABLE OF CONTENTS AREA:    </strong></p>     <p>Theme Header Text: <br>       <input name="themeHeader" type="text" value="" size="50">       <br>       <br> Life Solutions Article Title:<br> <input name="lifeSolutionsArticle" type="text" value="" size="50"> <br> <br> Life Solutions Article Author: <br> <input name="lifeSolutionsAuthor" type="text" value="" size="50"> <br> <br> Work Solutions Article Title:<br> <input name="workSolutionsArticle" type="text" id="work-solutions-article" value="" size="50"> </p>     <p>Work Solutions Article Author:<br>       <input name="workSolutionsAuthor" type="text" id="work-solutions-author" value="" size="50"> <br>       <br> Feature Article Title:<br> <input name="featureArticle" type="text" value="" size="50">     </p>     <p>Feature Article Author:<br>       <input name="featureAuthor" type="text" value="" size="50"> </p>     <p>Lighter Side  Title:<br>       <input name="lighterSide" type="text" value="" size="50"> </p>     <p><strong>CONTENT AREA </strong></p>     <p>Highly Recommended:<br>       <textarea name="highlyRecommendedContent" cols="100" rows="3"></textarea> </p>     <p>Today's Action:<br>       <textarea name="todaysActionContent" cols="100" rows="3"></textarea> </p>     <p>Life Solutions Article :<br>       <textarea name="lifeSolutionsArticle" cols="100" rows="3"></textarea> </p>     <p>Life Solutions Ad-Tracker:<br>             <span class="style5">(Example: &lt;a href=&quot;http://www.ecomincs.com/sampleadtrack.etc&quot;&gt;Click Here&lt;/a&gt;) </span><br>       <input name="lifeSolutionsAdtrack" type="text" value="" size="100"> </p>     <p>Advertisement Slot #1:<br>       <textarea name="adSlot1" cols="100" id="ad-slot1"></textarea> </p>     <p>Work Solutions Article :<br>       <textarea name="workSolutionsContent" cols="100" rows="3" id="work-solutions-content"></textarea> </p>     <p>Work Solutions Ad-Tracker:<br>         <span class="style5">(Example: &lt;a href=&quot;http://www.ecomincs.com/sampleadtrack.etc&quot;&gt;Click Here&lt;/a&gt;) </span><br>         <input name="workSolutionsAdtrack" type="text" id="work-solutions-adtrack" value="" size="100">     </p>     <p>Advertisement Slot #2:<br>       <textarea name="adSlot2" cols="100" id="ad-slot2"></textarea>     </p>     <p>Feature Article :<br>       <textarea name="featureContent" cols="100" rows="3" id="feature-content"></textarea> </p>     <p>Feature Ad-Tracker:<br>         <span class="style5">(Example: &lt;a href=&quot;http://www.ecomincs.com/sampleadtrack.etc&quot;&gt;Click Here&lt;/a&gt;) </span><br>         <input name="featureAdtrack" type="text" id="feature-adtrack" value="" size="100">     </p>     <p>Advertisement Slot #3:<br>         <textarea name="adSlot3" cols="100" id="ad-slot3"></textarea>     </p>     <p>Lighter Side (Humor Article):<br>       <textarea name="lighterSideContent" cols="100" rows="3" id="lighter-side-content"></textarea> </p>     <p>Copyright/Disclaimer Information :<br>       <textarea name="copyrightContent" cols="100" id="copyright-content"></textarea> <br>       <br>       <input type="submit" name="submit" value="Submit - Only Press this one time.">     </p>     <p><a href="http://www.mypalsystem.com/mypal-training/ezine-template-wizard/template.php" target="_blank">View Ezine </a><br>     (View only after hitting submit button) </p>   </div> </form> <?php } else { $szero = $_POST['logo']; $sone = $_POST['contact']; $stwo = $_POST['themeHeader']; $sthree = $_POST['lifeSolutionsArticle']; $sfour = $_POST['lifeSolutionsAuthor']; $sfive = $_POST['workSolutionsArticle']; $ssix = $_POST['workSolutionsAuthor']; $sseven = $_POST['featureArticle']; $seight = $_POST['featureAuthor']; $snine = $_POST['lighterSide']; $sten = $_POST['highlyRecommendedContent']; $seleven = $_POST['todaysActionContent']; $stwelve = $_POST['lifeSolutionsContent']; $sthirteen = $_POST['lifeSolutionsAdtrack']; $sfourteen = $_POST['adSlot1']; $sfifteen = $_POST['workSolutionsContent']; $ssixteen = $_POST['workSolutionsAdtrack']; $sseventeen = $_POST['adSlot2']; $seighteen = $_POST['featureContent']; $snineteen = $_POST['featureAdtrack']; $stwenty = $_POST['adSlot3']; $stwentyone = $_POST['lighterSideContent']; $stwentytwo = $_POST['copyrightContent']; mysql_query("INSERT INTO `sections` (logo, content, themeHeader, lifeSolutionsArticle, lifeSolutionsAuthor, workSolutionsArticle, workSolutionsAuthor, featureArticle, featureAuthor, lighterSide, highlyRecommendedContent, todaysActionContent, lifeSolutionsContent, lifeSolutionsAdtrack, adSlot1, workSolutionsContent, workSolutionsAdtrack, adSlot2, featureContent, featureAdtrack, adSlot3, lighterSideContent, copyrightContent) VALUES ('$szero', '$sone', '$stwo', '$sthree', '$sfour', '$sfive', '$ssix', '$sseven', '$seight', '$snine', '$sten', '$seleven', '$stwelve', '$sthirteen', '$sfourteen', '$sfifteen', '$ssixteen', '$sseventeen', '$seighteen', '$snineteen', '$stwenty', '$stwentyone', '$stwentytwo')"); echo "Success! Your ezine content has been added! Hit The Back Button to view the Ezine below the Submit button."; } ?> </body> </html></body> </html>[/quote] Tks, Brad. :)
×
×
  • 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.