I have a database table made in phpmyadmin. I want the elements of the table to be stored row-wise in an array. I have three columns named edge_id, vertexA and VertexB. I want the elements of these three columns to be stored into an array.
I don’t know those commands for PHP. Please help me out.
The simplest way would be:
So with PDO:
Now if you need to use input data you need to escape it. The best way to do this is to use a prepared statement because escaping is handle when the parameters are bound to the query.
Lets say for example you want to use the
edge_idsupplied from a get request likemysite.com/show-boundry.php?edge=5…Also you shouldnt use mixed case column/table names like
vertexAinstead use underscore separators likevertex_a.