Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by funbinod

  1. i think thats not the solution to my problem. my problem IS NOT that i could not extract data from table. my problem IS i coludn't put that data in a DROPDOWN list. or i didn't understand ur sugestion?????
  2. i created loop for selecting from all the rows of a table like this--- <?$rows = mysql_num_rows($result);for ($n = 0 ; $n < $rows ; ++$n) { echo '' . mysql_result($result,$n,'item') . '<br />'; }?> and tried to put in dropdown menu like this ---- echo '<form action="#" id="test" name="test">';echo '<select name="item">';echo "<option></option>";echo "<option>";{echo '' . mysql_result($result,$n,'item') . '<br />';}echo "</option>";echo '</select>';echo '</form>'; but returned error "Warning: mysql_result(): Unable to jump to row 2 on MySQL result index 5 in .................................." please guide me....
  3. funbinod

    dropdown menu items

    tried to put in dropdown menu like this ---- echo '<form action="#" id="test" name="test">';echo '<select name="item">';echo "<option></option>";echo "<option>";{echo '' . mysql_result($result,$n,'item') . '<br />';}echo "</option>";echo '</select>';echo '</form>'; but returned error "Warning: mysql_result(): Unable to jump to row 2 on MySQL result index 5 in .................................."
  4. funbinod

    dropdown menu items

    i created loop for selecting from all the rows of a table like this--- <?$rows = mysql_num_rows($result);for ($n = 0 ; $n < $rows ; ++$n) { echo '' . mysql_result($result,$n,'item') . '<br />'; }?> but couldn't insert it into a dropdown list. please guide...
  5. wow! and i got it! i just edited this to - $("#add").val($("#shipAdd").val()); and it worked....
  6. wow! thank u both of u for the guidance. i made it work now. now i again stuck on retriving data for "Billing Address" from "Shipping Address" field for 'IF CHECKED' clause. i tried this $("#add").val($("#shipAdd")); but it didn't work. please guide...
  7. i tried this - to disable form field if CHECKED and if UNCHECKED cancel disable. but it didnt work on my browser "chrome 33.0.1726.0" and "IE 11". please help me find out the error..... please help me find out the error ------ <form action="#"><h3><u>Shipping Address:</u></h3>Address:<input type="text" name="shipAdd" id="shipAdd"><br /><br />City:<input type="text" name="shipCity" id="shipCity"><br /><hr align="left" width="15%" noshade color="#996666" />Billing address same as shipping address.<input type="checkbox" name="billAdd" id="billAdd"><br /><br />Address:<input type="text" name="add" id="add" class="baddr"><br /><br />City:<input type="text" name="city" id="city" class="baddr"><br /><br /><input type="submit" name="submit" id="submit" value="SUBMIT"></form><script type="text/javascript"> $(document).ready(function(e) { $("#billAdd").click(function() { if ($("#billAdd").attr("checked") == "checked") { $(".baddr").val(""); $(".baddr").attr("disabled","disabled"); } else if ($("#billAdd").attr("checked") == "undefined") { $(".baddr").removeAttr("disabled"); } }); });</script>
  8. funbinod

    dropdown menu items

    how to make a dropdown menu on a FORM with the datas from a column of a database table like items from all rows of a "MEMBERS" table's "NAME" column
  9. sorry sir! i didnt meen to make u do my work. actually i'm not doing any work. m not in any mission. i just imagined something and tried to do it. but i forgot that i'm nothing on coding. i've just started learning php and i tried on applications. i know almost nothing about php & mysql, that's why i stuck on every step i move on. since i'm very new on coding, it was bitta difficult for me to understand, so i asked u for direct help. i didnt imagine it will be kind of asking to do work in my favor. but i think i got some idea from this reply and i can try my code now. i'll try and will be back. one thing more before i move on - 'can this be done within a FORM?' i mean select 'where' clause from a form field and data be displayed on next form field. thank u for ur kind support..
  10. i want to know if it it possible to make desktop application using PHP & MYSQL or not. if yes please suggest any application for that or some ideas....
  11. didn't u see the image!? sorry for that. i think the attached image describes my problem. sorry! i'vent attached my code. u might be more confused seeing my code . (coz m very fresh on coding) please try understanding from the image attached. if u still got confused, i'will post what i've written..... thank u for kind reply.
  12. i'm sorry sir! but its completely confusing for me. i cant understand how is this made done. can u please, if u dont mind, write that code, for example, so that i can understand this more easily. what i designed the invoice and wish it to do is like this--- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>TEST CASHIER</title> <link rel=stylesheet href=style.css?> </head> <body bgcolor="#999999"> <h1>Test Invoice</h1> <h3>Customer Name: Laptop House</h3> <table align="left" width="75%" cellspacing="10" border="1"> <tr> <td width="50%" valign="top"> <table leftmargin=0 marginheight=0 marginwidth=0 topmargin=0 border=1 cellspacing=0 width="100%"> <form action="tempinvoice.php" method="POST" id="cart"> <tr> <td width=120>Item Code: </td> <td><input type=text name=icode style="width:900;"></td><!-- Item Code' is entered here--> </tr> <tr> <td>Item Name: </td> <td><input type=text name=item style="width:900" readonly="readonly"></td><!-- Item Name' is displayed here auto --> </tr> <tr> <td>Rate:</td> <td><input type=text name=rate style="width:900" readonly="readonly"></td><!-- & 'Rate' is displayed here auto --> </tr> <tr> <td>Quantity:</td> <td><input type=text name=qty style="width:900"></td> </tr> <tr> <td>Discount (%):</td> <td><input type=text name=less style="width:900"></td> </tr> <tr> <td>Amount:</td> <td><input type=text name=amt style="width:900"></td> </tr> <tr> <td> </td> <td ><input type=submit class="nav" value='Add to Cart'></td> </tr> <input type=hidden name=action value=doregister> </form> </table> </td> <td align="center"> </td> <!-- & every item added to cart is displayed here in a table (with customer name) which would be posted at once to the database --> </tr> </table> </body> </html>
  13. thank u! i think this is now on the way to my goal. i tried ur suggestive code as my own like this - <?$icode = '$_POST[icode]';$stmt = mysqli_prepare($con, 'SELECT icode, item FROM stock WHERE icode=$_POST[icode]');mysqli_stmt_bind_param($stmt, 's', $icode);mysqli_stmt_execute($stmt);mysqli_stmt_bind_result($stmt, $icode, $item);while (mysqli_stmt_fetch($stmt)) { echo $item;}?> buy it showed no result. please help finding problem. thank u
  14. sorry sorry! i think i wrote wrong. i wish a TABLE be treated as FORM, not FORM as TABLE. and more important is "MOVE EVERY DATA FROM A DATABASE TABLE TO ANOTHER AND DELETE IT WITH A SINGLE SUBMIT". can u please help me with this...???
  15. i want to try an invoice script but got confused at one place. how to get information from a database table with MANUALLY SELECTING 'WHERE' clause? i wish a code be entered manually on a form and its details be displayed automatically. attached is the file what i made and it describes what i wish to be. please guide.
  16. thank u. can't the table be treated as form!? i mean all are coded in FORM but displayed as TABLE! if not could we MOVE all data from a database table to another and delete it with a single SUBMIT!?
  17. please help me inserting data to mysql database table from a html table. like <table> <tr> <td>name</td> <td>Gender</td> <td>age</td> <td>school</td> </tr> <tr> <td>John</td> <td>Male</td> <td>21</td> <td>Oxford</td> </tr> <tr> <td>Juliya</td> <td>Female</td> <td>25</td> <td>Oxford</td> </tr><!- bla! bla! bla! --></table>SUBMIT I want to send all the rows' data at once to a table. Please guide how could it be done!
  18. thank u again. and again confusion continues. (sorry! its because am newbie in php or programming) let me explain differently. if 'peter' is selected as 'first name', then it echos his 'last name'. i understood this line. but if i want to echo 'last name' of another name (lets say 'john') then should i have to write another code like <? $result = mysqli_query($con,"SELECT * FROM PersonsWHERE FirstName='John'");while($row = mysqli_fetch_array($result)) { echo $row['FirstName'] . " " . $row['LastName']; echo "<br>"; } ?> and similar for each name! or can i write a single line for each and every data!? (if u'll feel comfortable seeing what i wrote, i would love to send u the file)
  19. thanks justsomeguy for ur kind reply. i've just begun working with databases. i've used SELECT & WHERE command that was taught on w3schools. but that taught selecting with one particular information. but i wish selecting from all rows.(m not sure how to explain either) w3schools taught me selecting from a single row like - <?php$con=mysqli_connect("example.com","peter","abc123","my_db");// Check connectionif (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); }$result = mysqli_query($con,"SELECT * FROM PersonsWHERE FirstName='Peter'");while($row = mysqli_fetch_array($result)) { echo $row['FirstName'] . " " . $row['LastName']; echo "<br>"; }?> it teaches if 'Peter' is selected as 'FirstName' then 'LastName' should be selected from same row. but i wonder if there is one thousand rows then should i have to write lines for each row? or there is alternative? or i misunderstood the code? please guide.
  20. am very fresh in php and whatever i learnt is from w3schools. i am trying to create invoice script. for this i wish if automatic display of "item name" & "price" by entering just "item code" be possible. there is a table for stock item with rows "item code", "item name", "price". please guide me. thank u.
  • Create New...