Jump to content

OsitoFour

New Members
  • Posts

    2
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

OsitoFour's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you! It worked. I did, however, look at the FETCH modes you linked to and chose FETCH_BOTH as I need both. If I were to write the whole script all over again I would use ASSOC here, but when I wrote this particular tool (it’s a seating chart) I didn’t know how to do something like this ${‘cell’.$count} and I’m spending so much time re-writing so much code to bring my PHP5 code up to PHP8 functionality standards that I just can’t re-write the entire tool the way I’d like to. THANK YOU for your help!!!
  2. I am upgrading from an older PHP and am having difficulty with this particular piece of code. I use to be able to refer to elements of an array pulled from a MySQL dB by their number placement within that dB table. That no longer seems to be functioning … at least not with the code I’ve been using. <?php include 'r_open_link.php'; $query = "SELECT * FROM ember_seating_charts WHERE course_id = 204"; $result= $pdo->query($query); $row = $result->fetch(); print "Cell 6: ".$row[6]." should be ".$row['cell1']."<br>"; ?> This is a test script I wrote to check the functionality of my code. $row[6] and $row[‘cell1’] should both be the same value because ‘cell1’ is the 7th field in that table. The code returns the proper value for $row[‘cell1’], but gives the error “Warning: Undefined array key 6 in /home/jandrews/public_html/test_gen.php on line 8” now. Thanks.
×
×
  • 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.