MySQL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

I tried doing this through the news server, but something messed up.

I just need to know how to make an HTML form write to a MySQL DB.  
This is what I have so far.



<?php
   $link_id = mysql_connect("localhost","admin","*******")
            or die("Unable to connect to SQL server");
        mysql_select_db("database",$link_id)
            or die("Unable to select database");
                                         ?>

 <?php

global $PHP_SELF

   ?>

 <?php
  // echo $results;
   ?>


<HTML>
<HEAD>
<TITLE>DB</TITLE>
</HEAD>

<BODY BGCOLOR="white">

<a href="index1.php"> Home </a>|<a href="list_db.php"> Display All
</a>|<a href=""> Search </a>
<BR>
Total Entries: 
<?php
    $query = "SELECT COUNT(*) FROM gradients"; 
    $num_count = mysql_query($query) or die("Select Failed!"); 
    $count = mysql_fetch_array($num_count); 

?>
 
<A HREF="
<?$PHP_SELF?>

?complete=1">
<?php echo $count[0]; ?>
</a>
 
<BR><div align="center"><img src=http://dataguy/logo_small.jpg>

<BR><b>Title for page</B><BR></div>

    <div align="center">
     <FORM METHOD="post" ACTION="<?php echo $PHP_SELF ?>">
  <HR><HR>
<PRE> <b>

            KWL WO#: <INPUT TYPE="text" NAME="kwo" VALUE="">
LSD: <INPUT TYPE="text" NAME="lsd" VALUE="">
     Date Completed: <input type="text" name="date" value="">
Well Name: <INPUT TYPE="text" NAME="well" VALUE="">
         Fieled/Pool: <INPUT TYPE="text" NAME="field" VALUE="">
Unique: <INPUT TYPE="text" NAME="uni" VALUE="">
          License #: <input type="text" name="license" value="">
Formation: <input type="text" name="formation" value="">
              Perfs: <input type="text" name="perfs" value="">
Event No.: <input type="text" name="event" value="">
  Well Fluid Status: <input type="text" name="fluid" value="">  Well
Status Mode: <input type="text" name="mode" value="">
   Well Status Type: <input type="text" name="type" value="">
Type V/D/H: <input type="text" name="vdh" value="">
         File Name:  <input type="text" name="file" value="">
KB: <input type="text" name="kb" value="">
                GRD: <input type="text" name="grd" value="">
Open Hole: <input type="text" name="open" value="">
               Sour: <input type="text" name="sour" value="">
Tubing Size: <input type="text" name="tube" value="">
           Landed @: <input type="text" name="landed" value="">
Casing Size: <input type="text" name="casing" value="">
           Landed @: <input type="text" name="landed2" value="">
Shut In Date: <input type="text" name="shut_date" value="">
       Shut In Time: <input type="text" name="shut_time" value=""> Pres
TUB/CAS KPAg: <input type="text" name="pres" value="">
           Tag PBTD: <input type="text" name="tag" value="">

<br>  <HR><HR>
	<INPUT TYPE="submit" VALUE="Submit">

</PRE>    </b>
</FORM>
</div>


<BR><BR>

</head>
</HTML>

[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux