suppose i have five tabels and i must form them html then link them database and php then i want to make query between them these five tabels and data in each one pleaze help me Table of suppliers Source no resource name Address mobile Tel e-mail
Customers table Customer no Customer name Address mobile Tel e-mail
Sales table Sales invoice no History Statement Item Goods number number price color payment Delivery date notes
Table purchases Purchase invoice number Date Number of purchase number statement item Price color payment Delivery date notes
Bucket table Goods number Payment invoice number Purchases Invoice number statement item number Cost price Selling price color Date of entry of the goods status
hello rasha turk
first of all your query is not well understood.don't make the things complicated as php/mysql is too easy easy to understand. if you need your answer answer some of my questions
mail me soon,for fast reply regard shankar 9540372629
hello ,srry because my qustions was not clear ,i hope to answer me soon i want form in html and insert the value to the msyql database no i dont retrieve the data, and not important which query u use
Table of suppliers Source no, resource name, Address, mobile, Tel, e-mail, Customers table, Customer no, Customer name, Address,mobile Tel, e-mail, Sales table, Sales invoice no, History,Statement,Item,Goods number,number,price,color,payment,Delivery date, notes,Table purchases,Purchase invoice number,Date ,Number of purchase,number,statement,item,Price,color,payment,Delivery date,notes,Bucket table,Goods number,Payment invoice number,Purchases,nvoice number,statement,item,number,Cost price,Selling price,color,Date of entry of the goods,status
<html> <form name="f" action="index.php"> <h2>Customers Table</h2> <table border=1> <tr><td>Customer No</td><td><input type="text" name="cno"></td></tr> <tr><td>Customer Name</td><td><input type="text" name="cname"></td></tr> <tr><td>Address</td><td><input type="text" name="caddress"></td></tr> <tr><td>Mobile</td><td><input type="text" name="cmobile"></td></tr> <tr><td>Telephone No</td><td><input type="text" name="ctno"></td></tr> <tr><td>Email</td><td><input type="text" name="cemail"></td></tr> </table> <p> <h2>Sales Table</h2> <table border=1> <tr><td>Sales Invoice No</td><td><input type="text" name="sino"></td></tr> <tr><td>History</td><td><input type="text" name="shis"></td></tr> <tr><td>Statement</td><td><input type="text" name="sstat"></td></tr> <tr><td>Item</td><td><input type="text" name="sitem"></td></tr> <tr><td>Goods Number</td><td><input type="text" name="sgno"></td></tr> <tr><td>Number</td><td><input type="text" name="no"></td></tr> <tr><td>Price</td><td><input type="text" name="sprice"></td></tr> <tr><td>Color</td><td><input type="text" name="scolor"></td></tr> <tr><td>Payment</td><td><input type="text" name="spayment"></td></tr> <tr><td>Delivery Date</td><td><input type="text" name="sdeldate"></td></tr> <tr><td>Notes</td><td><textarea name="snotes" cols="15" rows="5"></textarea></td></tr> </table> </p> <p> <h2>Table purchases</h2> <table border=1> <tr><td>Purchase invoice number</td><td><input type="text" name="pino"></td></tr> <tr><td>Date</td><td><input type="text" name="pdate"></td></tr> <tr><td>Number of purchase</td><td><input type="text" name="pnpur"></td></tr> <tr><td>Number</td><td><input type="text" name="pno"></td></tr> <tr><td>Statement</td><td><input type="text" name="pstat"></td></tr> <tr><td>Item</td><td><input type="text" name="pitem"></td></tr> <tr><td>Price</td><td><input type="text" name="pprice"></td></tr> <tr><td>Color</td><td><input type="text" name="pcolor"></td></tr> <tr><td>Payment</td><td><input type="text" name="ppayment"></td></tr> <tr><td>Delivery Date</td><td><input type="text" name="pdeldate"></td></tr> <tr><td>Notes</td><td><textarea name="pnotes" cols="15" rows="5"></textarea></td></tr> </table> </p> <p> <h2>Bucket table</h2> <table border=1> <tr><td>Goods number</td><td><input type="text" name="bgno"></td></tr> <tr><td>Payment invoice number</td><td><input type="text" name="bpbo"></td></tr> <tr><td>Purchases</td><td><input type="text" name="bpur"></td></tr> <tr><td>Invoice Number</td><td><input type="text" name="binvNo"></td></tr> <tr><td>Statement</td><td><input type="text" name="bstat"></td></tr> <tr><td>Item</td><td><input type="text" name="bitem"></td></tr> <tr><td>Number</td><td><input type="text" name="bnum"></td></tr> <tr><td>Cost Price</td><td><input type="text" name="bcrice"></td></tr> <tr><td>Selling Price</td><td><input type="text" name="bsprice"></td></tr> <tr><td>Color</td><td><input type="text" name="bcolor"></td></tr> <tr><td>Date of entry of goods</td><td><input type="text" name="bentryOfGoods"></td></tr> <tr><td>Status</td><td><input type="text" name="bstatus"></td></tr> </table> </p> <input type="submit" value="Submit"> </form>
<?php $host = "localhost"; $user = "root"; $password = "root"; $database = "test"; $connection = mysql_connect($host,$user,$password) or die("Could not connect: ".mysql_error()); $connection1 = mysql_connect($host,$user,$password) or die("Could not connect: ".mysql_error()); mysql_select_db($database,$connection) or die("Error in selecting the database:".mysql_error()); if (isset($_POST['name'])) { $cno=$_POST["cno"]; $cname=$_POST["cname"]; $caddress=$_POST["caddress"]; $cmobile=$_POST["cmobile"]; $ctno=$_POST["ctno"]; $cemail=$_POST["cemail"]; $sql="insert into customers(customerNo,name,address,mobile,telephone,email) values('".$cno."',".$cname.",".$caddress.",".$cmobile.",".$ctno.",".$cemail.")"; mysql_query($sql,$connection); $sino=$_POST["sino"]; $shis=$_POST["shis"]; $sstat=$_POST["sstat"]; $sitem=$_POST["sitem"]; $sgno=$_POST["sgno"]; $no=$_POST["no"]; $sprice=$_POST["sprice"]; $scolor=$_POST["scolor"]; $spayment=$_POST["spayment"]; $sdeldate=$_POST["sdeldate"]; $snotes=$_POST["snotes"]; $sql1="insert into sales(salesInvoiceNo,history,statement,item,goodsNumber,number,price,color,payment,deliveryDate,notes) values('".$sino."',".$shis.",".$sstat.",".$sitem.",".$sgno.",".$no.",".$sprice."',".$scolor.",".$spayment.",".$sdeldate.",".$snotes.")"; mysql_query($sql1,$connection); $pino=$_POST["pino"]; $pdate=$_POST["pdate"]; $pnpur=$_POST["pnpur"]; $pno=$_POST["pno"]; $pstat=$_POST["pstat"]; $pitem=$_POST["pitem"]; $pprice=$_POST["pprice"]; $pcolor=$_POST["pcolor"]; $ppayment=$_POST["ppayment"]; $pdeldate=$_POST["pdeldate"]; $pnotes=$_POST["pnotes"]; $sql12="insert into purchases(purchaseInvoiceNo,date,noOfPurchase,number,statement,item,price,color,payment,deliveryDate,notes) values('".$pino."',".$pdate.",".$pnpur.",".$pno.",".$pstat.",".$pitem.",".$pprice."',".$pcolor.",".$ppayment.",".$pdeldate.",".$pnotes.")"; mysql_query($sql2,$connection); $bgno=$_POST["bgno"]; $bpbo=$_POST["bpbo"]; $bpur=$_POST["bpur"]; $binvNo=$_POST["binvNo"]; $bstat=$_POST["bstat"]; $bitem=$_POST["bitem"]; $bnum=$_POST["bnum"]; $bcrice=$_POST["bcrice"]; $bsprice=$_POST["bsprice"]; $bcolor=$_POST["bcolor"]; $bentryOfGoods=$_POST["bentryOfGoods"]; $bstatus=$_POST["bstatus"]; $sql13="insert into bucket(goodsNumber,paymentInvoiceNumber,purchases,invoiceNumber,statement,item,number,costPrice,sellingPrice,color,dateOfEntryGoods,status) values('".$bgno."',".$bpbo.",".$bpur.",".$binvNo.",".$bstat.",".$bitem.",".$bnum."',".$bcrice.",".$bsprice.",".$bcolor.",".$bentryOfGoods.",".$bstatus.")"; mysql_query($sql3,$connection); mysql_close($connection); } ?>