![]() |
SQL column as array
i know this is probably really simple... but im writing a fairly complicated download script which adds info to database depending on what is located in the downloads folder. im trying to get php to delete the row from the database if the file gets deleted from the directory. i have figured easiest way is to compare arrays. one database array and one directory array. thing is im not sure how to get a SQL column as an array. all i need is one column as an array. i know php can put rows into arrays but i coudltn work out columns.
thanks in advance, Piercy |
maybe something like
:
$results = mysql_query("SELECT theColumn FROM someTable WHERE someCondition", $db_link); |
i tried that witha few adjustments here and there but it seemd to out put nothing at all. i had array printing in for debugging and even that aint working. plus the code originally outputted a table displaying all rows in the table. Also below is the whole of my code(twice one with you code one with my own that didnt work.) ALso should be output screen shots here:
http://www.1hess.com/piercy/images/ Heres the changes i made: :
$results = mysql_query("SELECT `title` FROM c1hess_evo69.nuke_downloads_downloads");Code with your addition: :
<?phpMy code before your addition: :
<?phpIgnore some of the excess variables. they bare there for easy change. (as i have to do this for 4 maybe more folders.). I really appreciate your help, |
this is a code excerpt I had laying around:
:
$query = "SELECT contact FROM Contacts WHERE user = " . $this->id; |
A friend has also geven me this to compare the database column with the folder. although his gives the same error as yours. Pretty sure its something in my code or maybe even server side.
:
while ($row = mysql_fetch_array($result, MYSQL_BOTH)) {Thanks for the help, |
cant work out to edit the above post. i managed to get the above code working. it all works fine. All i need help on now is Zipping files. (in another thread)
Thanks for your effort, |
| All times are GMT -5. The time now is 1:37 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC