Hello list,

I am able to get the query to work by itself but it will not work using
the if (isset ($submit)) and NO errors are outputting...nothing.  

Any suggestions would be greatly appreciated.  I havnt even gotten to
the form variables yet...and yes, my globals are turned on (at least for
now).  Are there error display holes that I have missed?

What am I doing wrong ???...

Here's code:

if (isset ($submit) ) 

        function showerror()
                die("Error " . mysql_errno() . " : " . mysql_error());
        $dbhost = "";
        $dbuname = "uname";
        $dbpass = "password";
        $dbname = "databasename";
        $link = mysql_connect ($dbhost, $dbuname, $dbpass) or die ("Unable to
        @mysql_select_db("$dbname") or die ("Unable to select database");
        //From other script - this query works but not on this page.    
        $query = "INSERT INTO `cust_info` (  `comp_name` , `city` , `state` )
VALUES ('test3', 'test3', 'test3');";
        if (!mysql_query ($query, $link ))
        echo "Here's query: $query";//nothing

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<h3>Welcome to<br>Toshiba International Corporation<br>Customer
<form name="form1" action="survey_index.php" method="post">
<table align="center" cellpadding="5">
<th colspan="2">Please Enter the Information Below and Press the
'Submit' <br>Button When Finished.<br>(All Fields
<td><b> Company Name:  </b></td>
<td><input type="text" name="comp_name" size="50"></td></tr>
<td><input type="text" name="city" size="50"></td>
<select name="state" size="1">
                <option value=""../>Choose one
                <option value=al>AL
                <option value=ak>AK
<tr><td><b>Contact Name:  </b></td>
<td><input type="text" name="contact" size="50"></td></tr>
<table align="center">
<tr ><td>
<input type="submit" value="Submit">

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to