Jump to content


  • Content Count

  • Joined

Community Reputation

0 Neutral

About mattix

  • Rank

Recent Profile Visitors

530 profile views
  1. Thank you, Barand. This is all new. I'll work on this.
  2. This is the data on the table. id, grpa, grpb 1, 1, 5 2, 4, 6 3, 8, 9 4, 3, 3 5, 5, 4 6, 7, 8 7, 9, 10 8, 10, 5 9, 10, 9 and this the desired table from the original table. I showed the expected table in horizontal view to prevent confusion. My real table is vertical in the code.
  3. I tried this before, it lists all category keys in the html table. It's supposed to list only the category key numbers that matches the value, if not the output to be blank.
  4. yes, this doesn't give error. but it doesn't list the category keys, it lists category values. any ideas there too? if not, thanks anyway.
  5. true. thanks. but even though i made the change you proposed, i still get the same error.
  6. How can I get rid of "Notice:Array to string conversion on line 78" error from this code? can i get a little help please? This is line 78 : $table .= $columnValue; Basically this code's supposed to do is to group the values from grpa, grpb of datatb to 4 different categories according to their value. and as end result, category index number of each category is put into the html table. Thanks. <?php include ("configd.php"); $sql = "SELECT grpa, grpb From datatb"; $result = $conn->query($sql); //categories $cat = [ 4 => [1, 2, 3
  7. Hello, I think this question is a bit of both php and mysql related. I hope I can get some help here. Especially with the mysql part. I have a table like this: CREATE TABLE days ( id INT AUTO_INCREMENT, daya INT, dayb INT, PRIMARY KEY (id) ); INSERT INTO days VALUES (70, 19, 18), (69, 20, 17), (68, 24, 25), (67, 19, 18), (66, 19, 17), (65, 17, 16); and mysql query and php snippet is this: $sql = "SELECT d1.id AS id1, d2.id AS id2, IF((d1.daya-d2.daya)=1,1,0) + IF((d1.daya-d2.dayb)=1,1,0) + I
  8. I meant the the code before adding alphabetical listing which I wanted to add later works. Thanks, Barand, I will try your code.
  9. I don't really seek an alternative code, the code works fine, I just can't make it work for the letters.
  10. Here I create monthly html tables for the data. So each month has its own table, and data. Each table has a unique id, and the cells too.
  11. I didn't write this part of code, and I don't have enough knowledge why it's preferred to use there. It assigns unique id's to each table, and unique dbval values to each td element. I'm trying to assign letters to first column instead of numbers which I thought would be a simple thing. but I can't figure out what's wrong here. Basically I want to list letters instead of numbers at the beginning of each row in the first cell.
  12. I’m trying to print letters a-z in the first column with the code below. but for some reason I can’t make it work. (it only prints the first letter “a” down the column). What is it I am doing wrong here? please! Here is the code I'm using: function print_table_tb ($conn, $id) { $sql = "SELECT stata,statb,statc FROM dbA"; $result = $conn->query($sql); if ($result->num_rows > 0) { $range = range('a', 'z'); $i = 0; echo "<table class='tbr' id='tb$id'>"; while($row = $result->fetch_assoc()) { $data = array
  13. Thanks for your answer. There are some characters with numbers in the table which sometimes I need them like this, and in this case, i just need the numbers. I'm trying to do two things together here. First is to remove the characters from the data (eg. if it is ".4", then it should be "4"), and after this (or together, I am open to all solutions) I want to filter show null instead of certain numbers (e.g, if my criteria is for "Tnex" is like Tnex<=10, then I would like to show "null" for the values from 1 to 10, and only display the rest of the values.
  14. I have the following piece of code which extracts the data from mysql table. Since some of the data have unwanted characters I use the preg_replace('/[^0-9]+/','',) function to remove them, and only to grab numbers from the rows. I would like to display null in the table cell for certain values like Tnex>=40, Mode>=20 etc. When I tried to do it in sql query with where clause, the rows that don't fit the criteria are not displayed on the table. Instead, I need the rows to be displayed, but just the values to be shown null or empty. For example, in a certain row if "Tnex" >= 40, t
  • 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.