Jump to content

Search the Community

Showing results for tags 'html table'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 5 results

  1. I have the following general mySQL query: $query = sprintf( "SELECT a.A, a.B, ..., a.C, FROM a WHERE a.A = %s ORDER by a.A;", implode(" OR a.A = ", $_SESSION['values'])); for some records, B has a value, and for others, B is NULL. That is what I want. I extract the query with the following PHP: for ($i = 0; $i < $nrows; $i++){ $row = mysqli_fetch_assoc($result);//fetches data stored within each row extract($row); echo "<tr>"; foreach($row as $column => $field){ if($field == $...){ ... } elseif($field == $C){ echo"<td> <input type='text' name='C+[]' value='$C'> </td>"; } echo "</tr>" } In the resulting html table, records containing not null B fields are presented accurately, while records with null B fields incur a duplication of field C. This offset occurs at the beginning of the record, pushing the final field in the record outside the table boundaries. I think I've narrowed down the problem to the extract() function, as r_print readouts of every other variable in the script returns the accurate field names and values. But, running print_r on $row after extract() provides an identical printout to other variables in the script. What are some possible ways I can stop the duplication of field C from occurring? Happy to provide more information upon request.
  2. Sorry for the beginner question, here I'm trying to retrieve data from the database and display it in the table format. But only table headers are printed, and not the actual values. The count variable is echoing 2 saying that data is present and correctly retrieved. Can anyone help? <?php include 'connect.php'; error_reporting(E_ALL ^ E_DEPRECATED); error_reporting(E_ERROR | E_PARSE); $sql="SELECT * FROM `resources` as r INNER JOIN `project_resources` as pr ON r.res_id =pr.res_id WHERE project_id='$_POST[project_id]'"; $result=mysql_query($sql); $count=mysql_num_rows($result); if($result === FALSE) { die(mysql_error()); } echo "$count"; echo '<table> <tr> <th>Resource ID</th> <th>Resource Name</th> <th>Email</th> <th>Phone Number</th> <th>Reporting Manager</th> <th>Role</th> <th>Designation</th> </tr>'; while ($row = mysql_fetch_array($result)) { echo ' <tr> <td>'.$row['res_id'].'</td> <td>'.$row['res_name'].'</td> <td>'.$row['email'].'</td> <td>'.$row['phone_number'].'</td> <td>'.$row['reporting_manager'].'</td> <td>'.$row['role'].'</td> <td>'.$row['designation'].'</td> </tr>'; } echo ' </table>'; ?>
  3. Hi guys, I am trying to find a way for a website user to copy a standard html table from a website and paste it in to a form on my website, which would then upload it to php to a mysql db. The table they would copy follows the same format however the fields could sometimes have either or numberical or characters as values. An example of a table I would be trying to upload to my DB is this: "Date Duty Dep Begin End Arr 1 Apr 14, Wed 7743 HME 04:40 Z 06:20 Z AWY 1 Apr 14, Wed 6473 AWY 06:45 Z 08:55 Z FRG 1 Apr 14, Wed 1231 FRG 09:20 Z 11:25 Z AWY 1 Apr 14, Wed 2222 AWY 11:50 Z 13:25 Z HME 2 Apr 14, Tue STDY0300-Z HME 03:00 Z 15:00 Z 3 Apr 14, Thu 6666 HME 05:00 Z 06:05 Z WAG 3 Apr 14, Thu 5555 WAG 06:30 Z 07:40 Z HME 3 Apr 14, Thu 2222 HME 08:05 Z 10:50 Z NWR 3 Apr 14, Thu 1111 NWR 11:15 Z 13:50 Z HME 4 Apr 14, Fri 4444 HME 04:15 Z 07:05 Z CKC 4 Apr 14, Fri 2222 CKC 07:45 Z 10:15 Z HME" Does anyone know the best way to try and separate the columns in each row to process with PHP? Thanks,
  4. I know the line below adds a table row but what is the significance of "alt"? <tr class="alt">
  5. so this is the scenario, i am creating an admin page using php and html and i do have an HTML table that is being populated dynamically, so what i want to do is, when i click the table row, i will be redirected to another page and print the details of the product i clicked from the table. i really got lost here.. i dont really need the whole code/answer, i just need to know how to extract the text that is clicked from the table thanks in advance guys!
×
×
  • 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.