Hey,
array_shift seems to work on another server, but it does not on mine.
The code is the following;
What I am trying to get done is the following;PHP Code:$realid = array_shift(explode("-", $id));
I have a URL, which is like [ example.com/48555-animal-name.html ]. How is it possible to ONLY get the ID which is 48555, to call an entry from the database?
Is there an another way of doing this, without using array_shift?PHP Code:$realid = array_shift(explode("-", $id));
$qryrec="select * from animals where id='$realid'";
$resultrec=mysql_query($qryrec) or die($qryrec);
$linerec=mysql_fetch_array($resultrec);
$pcommon = ucwords($linerec[common]);
Thanks,


LinkBack URL
About LinkBacks



Reply With Quote


Bookmarks