+ Reply to Thread
Results 1 to 2 of 2

Thread: Contact over msn to help fix my problem

  1. #1
    goldy30's Avatar
    goldy30 is offline x10Hosting Member goldy30 is an unknown quantity at this point
    Join Date
    Jul 2008
    Posts
    60

    Question Contact over msn to help fix my problem

    I'm trying to insert title and blurb into the database but it's not working. It's actually code which someone else gave me. Still learning.

    Heres what I have:
    PHP Code:
    <?php
    include ("../database.inc");
    ?>
    <?php
    $pageid
    =$_POST["pageid"];
    $details mysql_fetch_array(mysql_query("SELECT pagename, blurb FROM pages WHERE pages_id='".$pageid."'"));
    ?>
    In the body:
    PHP Code:
    <td>
                                    Title:<br>
                                    <?php
                                    
    echo '<input name="title" size="40" value="'.$details[0].'" type="text">'// this code should  be for your title ?><br>
                                </td>
                            <tr>
                                <td>
                                    Page Info:<br>
                                    <?php

                                    
    echo '<textarea name="blurb" rows="7" cols="60">'.$details[1].'</textarea>'// this code should  be for your Page Info at text area
                                    
    ?>
                                    
                                </td>
    and this is the insert.php file:
    PHP Code:
    <?php
    include ("../database.inc");
    ?>
    <?php
    $pageid 
    $_POST['pageid'];
    $blurb $_POST['blurb'];
    $title $_POST['title'];

    mysql_query("INSERT INTO `pages` ('title','blurb') VALUES ('$title','$blurb') WHERE `pages_id` = '0'");  
    ?>

    <?php
    I would appreciate if someone could contact me on msn airbrushkits@live.com and I can send you files, upload and check changes.

  2. #2
    mephis's Avatar
    mephis is offline x10Hosting Member mephis is an unknown quantity at this point
    Join Date
    Aug 2008
    Location
    London, UK
    Posts
    39

    Re: Contact over msn to help fix my problem

    Quote Originally Posted by goldy30 View Post
    PHP Code:
    <?php
    include ("../database.inc");
    ?>
    <?php
    $pageid 
    $_POST['pageid'];
    $blurb $_POST['blurb'];
    $title $_POST['title'];

    mysql_query("INSERT INTO `pages` ('title','blurb') VALUES ('$title','$blurb') WHERE `pages_id` = '0'");
    ?>

    <?php
    try changing your SQL statement to this:

    PHP Code:
    mysql_query("INSERT INTO `pages` (`title`, `blurb`) VALUES ('$title', '$blurb') WHERE `pages_id` =  '0'"); 
    use ` around table/field names and ' around the data you're inserting

+ Reply to Thread

Similar Threads

  1. Which is the problem of my account? Part 2 xD
    By GodMew in forum Free Hosting
    Replies: 2
    Last Post: 01-17-2008, 09:57 AM
  2. Cossacks Problem Again!!
    By muhammadsameja in forum Free Hosting
    Replies: 1
    Last Post: 01-08-2008, 10:47 AM
  3. Replies: 2
    Last Post: 12-14-2007, 09:21 AM
  4. Ftp Timeout problem
    By ironcross77 in forum Free Hosting
    Replies: 7
    Last Post: 04-12-2005, 08:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers