Jump to content

edgustaf

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Everything posted by edgustaf

  1. Your a genius! Thank you soo much!!
  2. Thanks so much. I am not receiving the error anymore but my database doesn't update for some reason.
  3. Would it matter if I was trying to insert html tags through the sql statement?
  4. Thank you for the replies. For some reason when I echo out the error it shows the the $updateid variable is not getting passed in the update statement but when I echo the $updateid by itsself it comes out fine.
  5. This is my code so far <?php include("includes/connect.php"); $updateid = $_GET["id"]; include("includes/connect.php"); $editquery = mysql_query("SELECT * FROM news WHERE id = '$updateid'"); $row = mysql_fetch_assoc($editquery); $currentid = $row["id"]; $currenttitle = $row["title"]; $currentdesc = $row["desc"]; $currentbody = $row["body"]; $currenttype = $row["type"]; $currentdate = $row["date"]; ?> <form style="margin:20px 0 0 0; padding:0;" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <label style="color:#000;">Title</label> <input type="text" name="title" size="40" value="<?php echo "$currenttitle"; ?>" /> <label style="color:#000;">News Ticker Description</label> <textarea cols="80" rows="10" name="desc"><?php echo "$currentdesc"; ?></textarea> <label style="color:#000;">Body</label> <?php // Make sure you're using correct paths here include_once 'ckeditor/ckeditor.php'; include_once 'ckfinder/ckfinder.php'; $ckeditor = new CKEditor(); $ckeditor->basePath = '/ckeditor/'; CKFinder::SetupCKEditor($ckeditor, '/ckfinder/'); $ckeditor->editor('body',$currentbody); ?> <input style="margin:20px 0 0 0;" type="submit" name="submit" value="Submit" /> </form> <?php $submit = $_POST["submit"]; $updatetitle = $_POST['title']; $updatebody = $_POST['body']; $updatetype = $_POST['type']; $updatedate = $_POST['date']; $updatedesc = $_POST['desc']; if ($submit) { $updatearticle = mysql_query("UPDATE news SET title = '$updatetitle', desc = '$updatedesc', body = '$updatebody' WHERE id = $updateid")or die(mysql_error()); echo "<h1>Article has been updated</h1>"; } ?> </div> </div> </div> <?php include("includes/footer.php"); ?> </div> </body> </html> MOD Edit: . . . tags added . . .
  6. When I am trying to update a record in the database i get this error after I submit the form that is populated from the database. 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 'desc = 'SFR ANNOUNCES 3RD ANNUAL \"12 DAYS OF CHRISTMAS FOOD DRIVE\"', body = '<' at line 1
  7. Can anyone help me figure out this problem i am receiving this error. Fatal error: Cannot increment/decrement overloaded objects nor string offsets in /home/edgustaf/public_html/cit313/showcart.php on line 46 [attachment deleted by admin]
  8. Got it! I had to switch the mysqli_num_rows with $foundnum = $run->num_rows;
  9. I tried that as well and it gives me these errors. Warning: mysqli_query() expects at least 2 parameters, 1 given in /home/edgustaf/public_html/cit313/search.php on line 45 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/edgustaf/public_html/cit313/search.php on line 46
  10. I am getting this error when I try to use my search engine that i developed. Does anyone know what it means. Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/edgustaf/public_html/cit313/search.php on line 46 I attached my search.php file [attachment deleted by admin]
×
×
  • 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.