Jump to content

Taku

Members
  • Posts

    44
  • Joined

  • Last visited

Everything posted by Taku

  1. oh sorry my apologies mam :c and I think I get what u meant now about creating a new table....>.< crap I will do that now, gonna go back here again >.< tnx so much
  2. well here is what I wanted to do... 1. I will choose a add function and then enter the name of that new branch 2. And then I want that branch to auto create a table after putting it in? or after pressing a button? 3. And then I want a drop down list thingy that will show all the branches, including the new one and then show its table :B yah I really need to logic on this one.. `.` tnx for replies
  3. I see... I will ask again.. is it possible to create a table whose name will be the value that is selected in a drop down? tnx for the replies!
  4. is that so :c... well I think this will work wherein I as soon as the user entered a data(via textfield) I will create a table with it.. now my problem is how to view those table and add them in the page..
  5. sorry for double post I cant edit the one above what I want to happen is auto-create a table that has a name based on the column emp... or when a user entered a data.. it will auto-create a table for that data
  6. I wanted to create a table that is based on the values inside another table example: table emp id emp 1 sec 2 pres what I want is when I add another data there it will auto create a table for them Hope someone can help tnx!
  7. I tried doing the 1st one it still gave me 0000-00-00 and the 2nd one work.. tnx so much guess I will use this one
  8. //+90 days $date = date("Y-m-d",strtotime("+90 day")); $date1 = date("Y-m-d",strtotime($date)); echo $date1; if(isset($_POST['Submit'])) { if(!$date1) { } else { $query1 = "UPDATE testdate SET end = $date1 WHERE id=1"; mysql_query($query1) or die('error'.mysql_error()); } } guys help... I wanted to get the default date then add 90 days on it and then update the table with its values.. but all I get is 0000-00-00
  9. Taku

    Question

    guess I will think of a way and post here if it is right xDD
  10. Taku

    Question

    I see tnx for this :3 I see... if I will not use date.. what is a good way to make a new table for each day? :B what I want to do is... it will create a new table everyday
  11. Taku

    Question

    ohh tnx so much :3.. I will read it and yea I need to create the table... btw is creating a table name using date possible?
  12. Taku

    Question

    After using inner join and getting ur desired values.. how to enter this values to a new table? tnx for replies :B
  13. ohhh tnx psycho, I think I got now the idea.. and if I want to subtract something I will add subtraction in the end? like this? SELECT t1.id, t1.quantity AS qty1, t2.quantity AS qty2, t3.quantity AS qty3, t4.quantity AS qty4, t5.quantity AS qty5 (t1.quantity + t2.quantity + t3.quantity + t4.quantity - t5.quantity) as total FROM table1 AS t1 INNER JOIN table2 AS t2 ON t2.id = t1.id INNER JOIN table3 AS t3 ON t3.id = t1.id INNER JOIN table4 AS t4 ON t4.id = t1.id INNER JOIN table5 AS t5 ON t5.id = t1.id
  14. sorry for disturbing again... I did try to do this.. and it seems not working `.` can someone explain what did I do wrong and how to fix this? :B tnx so much $sql = " SELECT t1.id, t1.quantity, t2.quantity, t3.quantity, t4.quantity (t1.quantity+t2.quantity+t3.quantity+t4.quantity) as total FROM t1 INNER JOIN t2 ON t2.id = t1.id INNER JOIN t3 ON t3.id = t2.id INNER JOIN t4 ON t4.id = t3.id $qry = mysql_query($sql); while($row = mysql_fetch_assoc($qry)) { echo $row['total']. '<br/>'; }
  15. just a question again.. how to inner join if I have more than 2 tables?
  16. ohhh Thank you very much guys, I know now how to do it tnx tnx
  17. oh sorry about that.. well try to ignore the select above for now.. also I did try to test this and it gave me the result I wanted wherein the 1st row of table A is added to the 1st row of table B... but what I wanted to do is to add all the row from table A and B like this... a b 1 2 4 5 ... ... . . wherein it will add 1 and 2 then 4 and 5 like this c 3 9 .... . I am really new at php and I don't know how to do this.. unless like that one by one...
  18. greetings! is this correct? <?php $input = mysql_real_escape_string($POST['select']) $sql = " SELECT ( SELECT (quantity) FROM test_req_concepcion WHERE id = 1 ) AS totalcafe, ( SELECT (quantity) FROM test_noval WHERE id = 1 ) AS totalcafe1"; $qry = mysql_query($sql); $row = mysql_fetch_assoc($qry); echo $row['totalcafe'] + $row['totalcafe1']; ?>
  19. <?php require "view_connect.php"; $query = "SELECT * FROM f_beg WHERE inven_id=4"; $result= mysql_query($query); $num=mysql_num_rows($result); $i=0; while ($i < $num); { $clt=mysql_result($result,$i,"Cafe_Latte"); $ct=mysql_result($result,$i,"Chocolate"); $i++; } ?> here is my code wherein I am planning to put the Cafe_Latte(from db table) to $clt(which is the name of the textfield) is this correct? (I believe I done something wrong because I don't know how to do this)
  20. an example on how to put the retrieve data from database to a textfields?
  21. tnx so much Christian, Muddy and Jessica all are working now haha tnx so much \o\
  22. if(isset($_POST['Edit'])) { echo "Success"; $u_cl = mysql_real_escape_string($_POST['clt']); $u_c = mysql_real_escape_string($_POST['ct']); $u_cb = mysql_real_escape_string($_POST['cbt']); $u_cc = mysql_real_escape_string($_POST['cct']); if(!$u_cl OR !$u_c OR !$u_cb OR !$u_cc) { echo '<script type="text/javascript">alert("Please fill up the form")</script>'; require "custodian_edit.php"; } else { $query1 = "UPDATE $tbl_name SET Cafe_Latte='$u_cl', Chocolate='$u_c', Creme_Brulee='$u_cb', Cookies_Cream='$u_cc' WHERE inven_id = 1"; mysql_query($query1) or die('error'.mysql_error().'in query'.$SQL); echo "Record Update"; } } anyone knows what I did wrong? I am trying to update the 1st row and it is not working...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.