cgi error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • sky2070

    cgi error

    <?php
    $user="root";
    $pass="";
    $db="inventory" ;
    $link=mysql_con nect("localhost ",$user,$pa ss);
    if(!$link)
    die("couldn't connect to mysql");
    print "successful ly connected to mysql<p>";
    mysql_select_db ($db)
    or die("i cant take it anymore ".mysql_error() );
    print "successful ly selcted database \"$db\"<p>";

    $query="insert into product(product _id,name,price) values('','Appl e
    powermac g5','2500.00')" ;
    mysql_query($qu ery,$link) or die("could't add data to \"product\"
    table: ".mysql_error() );
    $result=mysql_q uery("select * from product");
    $num_rows=mysql _num_rows($resu lt);
    print "there are currently $num_rows is the table<p>";
    print "<table boder=1>\n";
    while($a_row=my sql_fetch_row($ result))
    {
    print "<tr>\n";
    foreach($a_row as $field)
    print "\t<td>$field<\ td>\n;
    print "</tr>\n"
    }
    print"<table>\n ";

    mysql_close($li nk);
    ?>

    display

    CGI Error
    The specified CGI application misbehaved by not returning a complete
    set of HTTP headers. The headers it did return are:
  • MeerKat

    #2
    Re: cgi error

    print "\t<td>$field<\ td>\n;

    needs a " at the end.

    sky2070 wrote:[color=blue]
    > <?php
    > $user="root";
    > $pass="";
    > $db="inventory" ;
    > $link=mysql_con nect("localhost ",$user,$pa ss);
    > if(!$link)
    > die("couldn't connect to mysql");
    > print "successful ly connected to mysql<p>";
    > mysql_select_db ($db)
    > or die("i cant take it anymore ".mysql_error() );
    > print "successful ly selcted database \"$db\"<p>";
    >
    > $query="insert into product(product _id,name,price) values('','Appl e
    > powermac g5','2500.00')" ;
    > mysql_query($qu ery,$link) or die("could't add data to \"product\"
    > table: ".mysql_error() );
    > $result=mysql_q uery("select * from product");
    > $num_rows=mysql _num_rows($resu lt);
    > print "there are currently $num_rows is the table<p>";
    > print "<table boder=1>\n";
    > while($a_row=my sql_fetch_row($ result))
    > {
    > print "<tr>\n";
    > foreach($a_row as $field)
    > print "\t<td>$field<\ td>\n;
    > print "</tr>\n"
    > }
    > print"<table>\n ";
    >
    > mysql_close($li nk);
    > ?>
    >
    > display
    >
    > CGI Error
    > The specified CGI application misbehaved by not returning a complete
    > set of HTTP headers. The headers it did return are:[/color]

    --
    MeerKat

    Comment

    Working...