php - array type of question -
i'm trying figure out way make small "table" style system in php 10 data rows. because requires constant editing, want replace mysql system in php directly.
the data 10 rows of:
id first name last name i give php file id , want pull out first name , last name.
i tried using associative array, turned coding mess syntax on place.
how can set 1 can edit data in single place , first , last name of row $id?
edit - example:
id fname lname 1 john ter 2 mark laken 3 peter lars 4 vlad morch basically, how set info above in php such can add new rows without trouble , code still work, , such possible output fname , lname $_get of id value...
hope makes sense!
i'm not understanding why wouldn't want store changing data in database, here how hardcode it:
$data = array( 'id01' => array( 'firstname' => 'eric', 'lastname' => 'smith', ), 'id02' => array( 'firstname' => 'john', 'lastname' => 'turner', ), ... ); if returning data in ajax call i'd along these line
echo json_encode($data[$id]); of course should test if value in $id in data array.
Comments
Post a Comment