Jump to content

draconlock

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Everything posted by draconlock

  1. thank you so much it worked. i am very greatful thank you.
  2. you guys are my last resort if you guys could please help I cannot figure it out.
  3. Hi guys, I'm very new at this php and ive been doing alot of research and I can't seem to get what I want and I figured you guys always have the answers so here it goes. Here is what the table in the db looks like: table1 iduseridproductqty 11paper20 21pencil40 31pen50 42paper20 52pen60 Here is my select statement: $query ="SELECT * FROM table1"; $result = mysql_query($query); Here is my current code and it currently prints out every line correctly but...: while ($data = mysql_fetch_object($result)) { $index = $data->id; $userid = $data->userid; $product = $data->product; $quantity= $data->qty; $printdata = [][]=array("$index","$userid ","$product","$quantity"); } I want it to display like below but by using an array? [/td]paperpencilpen 1204050 220[td]60 Could anyone please help me I would greatly appreciate it. Thank you.
  4. Ok nvm I saw what I did wrong it actually works. Thanks alot guys your the best
  5. Its actually printing for some reason. 1 | 2009-12-28 | Unpaid 3 | 2010-02-28 | Unpaid
  6. Yes the date in table2 is actually the due date.
  7. Hi Everyone, I have a problem. So here is my setup. TABLE1 id | firstname ------------------------ 1 | John 2 | Susan 3 | Michael TABLE2 userid | date | payment ------------------------------- 1 | 2009-12-28 | Unpaid 2 | 2010-02-10 | Paid 3 | 2010-02-28 | Unpaid This is my select statement select table1.id, table1.firstname, table2.userid, table2.date, table2.payment from table1 inner join table2 on table2.userid=table1.id where payment='Unpaid' order by table1.id My problem is I want to only select/print the row, where the date is past due and unpaid. Can someone help me figure this out, I can't get it to work and i'm new at this. Thanks
  8. Could someone please help me. table1 information with column and values: ID Username Items 1 Joe Pencil 2 Joe Paper 3 Joe Pen 4 Sue Crayons 5 Sue Plastic 6 Sue Eraser here is my current code, currently it does display the values but it shows a new line for every single item: $reportdata["tableheadings"] = array("UserID","Name","Items"); $query = "SELECT * FROM table1"; $result = mysql_query($query); while ($data = mysql_fetch_object($result)) { $userid = $data->id; $name = $data->username; $item = $data->items; $reportdata["tablevalues"][] = array($userid,$name,$item); } mysql_free_result($result); here is my question and problem: How would I go on about to have it print out in this format below? I can't get it to post right but it will be in a table with two columns and 3 rows for this example. Username Items Joe Pencil Paper Pen Sue Crayons Plastic Eraser I can't figure it out from this point if anyone could help me I would greatly appreciate it. Thanks, Joe
×
×
  • 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.