Jump to content

TheAlmightyOS

Members
  • Posts

    5
  • Joined

  • Last visited

TheAlmightyOS's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. I thought it might be that I missed the > in $field-name but that does not work. Changing it to $field->name gives me the same result. I don't even know if I am going about this the right way.
  2. I have been staring at that line for hours and googling for an answer. I know I screwed up that line but I can not figure out where. I do know it is something stupid and it is going to smack me in the face hard when I find it. BTW, I am VERY new to php and programming in general. I'm a server admin, not a programmer. Don't laugh too hard.
  3. I want to say I am almost there. I can connect to the DB, I have a query stored and it runs fine and I can output the result into a table. But this is where I have hit a wall. Code Below: $conn = mysqli_connect($db_host, $db_user, $db_pwd, $database);$result = mysqli_query($conn,$query) or trigger_error($querry . ' - has encountered an error at:<br />' . mysqli_error($conn));$fields = mysqli_fetch_fields($conn);$field_count = mysqli_num_fields($conn);echo '<table border="1" style="width:100%">' . "n" . '<tr>';$i = 0;foreach($fields as $field){ if(++$i == 1) { echo '<th colspan="' . $field_count . '">' . $field->table . '</th></tr><tr>'; }echo "n" . '<th>' . $field-name . '</th>';}echo '</tr>';while($row = mysqli_fetch_row($result)) { echo '<tr><td>' . implode('</td><td>' , $row) . '</td></tr>';}echo '</table>'; This gives me a nice table but it needs some formatting. Will do that with CSS later. My core concern is this: everything prints out but the column titles. I went looking through the mysqli_fetch functions to see if there was a fetch header or something similar but no dice. The mysql API had a field_name function. Does mysqli have something similar? The second part of my question I might be able to figure out with enough poking around. I want the script to look at the value of the cell and if it meets the criteria it is edited in a specific way. For instance, if the contents of a cell starts with "HTTP" I want to put link tags around it. Is it possible?
  4. Thank you for the straight forward answer. I think I know how I am going to move forward on my project now. Thank you. New here (obviously), is there a "solved" link or something I need to push?
  5. Hello all. I have come here to the source of web standards to understand PHP and the API's it uses to access databases. From my reading (why yes, I do know how to use google ) it seems both MySQLi and PDO are acceptable methods. Other than the boatload of "experts" on various forums and blogs shouting that MySQLi is depreciated, is there any real indication that it is? Now I don't want to start a MySQLi Vs PDO thread. I just want to know if MySQLi is still an acceptable API to use
×
×
  • Create New...