
loshyt
Members-
Posts
13 -
Joined
-
Last visited
Never
Everything posted by loshyt
-
how to run a random sql that look for one peremeter?
loshyt replied to loshyt's topic in PHP Coding Help
many thanks. -
here is the database: its a facebook app i want that my sql will choose every time random but considerate in the sex parameter. i mean that if the user is boy i will put it in parameter and boys is num-1 girls-0 and if the user is boy it will run random sql just on the boys and if its girls so random on the girls here what i did: $sql = "SELECT * FROM pcm ORDER BY RAND() LIMIT 1"; $Recordset3 = mysql_query($sql) or die(mysql_error()); $row2 = mysql_fetch_object($Recordset3); print_r($row2); but for some reason i get an error that the database is not selected maybe i didnt select my database right? plz help tnx....
-
tnx silly me!
-
ok im building facebook app and im just back to php after months not touched it. this is the code: $image = $facebook->api_client->photos_get(null,null, echo $uid); print_r ($image); echo "<BR>"; echo $image[0]["src"]; the problem is that echo $uid i tried every variation and it does not work! i maybe forget something that i should have done? the $uid containing user id numbers so what i did wrong and if im not wrong i wanted the numbers($uid) Wrapped in quotation marks so i tried: echo ." $uid ". and alot of other plz help tnx
-
keep getting error when UPDATE mysql statement plz help.
loshyt replied to loshyt's topic in PHP Coding Help
wow thanks guys @Pikachu2000 youve guessed correctly and now i think i will quote everything... and @ManiacDan i didnt call it in a meaningful name becuse its a second $sql in a page that update so i could not go wrong with what it does.. thanks again to you two... -
ive tried to write the $sql in so many ways and this looks the best and its still not working and ive checked the correct syntax but still. this is how i wrote: $sql2 = "UPDATE `tvchaty`.`episodes` SET `showid` = ".($showid).", `epname` = ".($epname).", `season` = ".($season).", `episode` = ".($episode).", `info` = ".($info).", `airdate` = ".($airdate).", `directwatch` = ".($directwatch)." WHERE `episodes`.`id` = ".($id)." LIMIT 1;"; this is the error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Prideses, `season` = 6, `episode` = 11, `info` = , `airdate` = 2010-11-01, `dire' at line 1 what could be the problem? tnx....
-
Upload image to my site using Webcam Help needed!
loshyt replied to loshyt's topic in Javascript Help
never asked for somone to work for me 4 free becouse this concept is everywhere i guessed there have to be somthing free and easy possible out there and u r the perfect guys to ask for -
i cant find any working stuff on this i cant just start learning as3 and flash development for a small feature :\ i found this two guides: http://www.marchawkins.com/2010/03/17/capture-and-upload-a-webcam-still-with-flash/ dont work for me do error couldnt make it work :| http://www.endseven.net/?p=9# didnt work for me to... im beggin you guys i really need this script just a simple snap from webcam and it upload to the site thats it.
-
Upload image to my site using Webcam Help needed!
loshyt replied to loshyt's topic in PHP Coding Help
but php and mysql and a bit of javascript is what i know so i ask if anyone have sulotion to this problem? i dont think it should be one for the masters here who can help me if somone can help me in msn it will be great to.. [email protected] -
i cant find any working stuff on this i cant just start learning as3 and flash development for a small feature :\ i found this two guides: http://www.marchawkins.com/2010/03/17/capture-and-upload-a-webcam-still-with-flash/ dont work for me do error couldnt make it work :| http://www.endseven.net/?p=9# didnt work for me to... im beggin you guys i really need this script just a simple snap from webcam and it upload to the site thats it.
-
Warning: implode() [function.implode]: Invalid arguments passed in
loshyt replied to loshyt's topic in PHP Coding Help
$user_string = "'". implode("','", $user_id) . "'"; The error is quite clear, $user_id is not an array. i dont get it i check everything and its set like an array ... but i tried to do is_array func to check and its working! U r the man !! -
Warning: implode() [function.implode]: Invalid arguments passed in
loshyt replied to loshyt's topic in PHP Coding Help
i didnt get what you saying should i do: WHERE userid 'in ($user_string)' order by stamp desc $extra"; if u can show me exactly on my code it will be clearer. and ofcurse $user_id is an array. tnx waiting 4 response -
i have a problem i cant solved for cople of hours! this is the function: function show_posts($user_id,$limit=0){ $posts = array(); $user_string = implode(',', $user_id); $extra = " and id in ($user_string) "; if ($limit > 0){ $extra = "limit $limit"; }else{ $extra = ''; } $sql = "SELECT userid, caption, stamp, filename FROM photographs WHERE userid in ($user_string) order by stamp desc $extra"; //echo $sql; $result = mysql_query($sql) or die(mysql_error()) ; while($data = mysql_fetch_object($result)){ $posts[] = array( 'stamp' => $data->stamp, 'userid' => $data->userid, 'caption' => $data->caption, 'filename' => $data->filename, ); } return $posts; } and thats the full error: Warning: implode() [function.implode]: Invalid arguments passed in C:\wamp\www\includes\functions.php on line 12 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') order by stamp desc' at line 2 and the intresting thing that if i echo the sql i get a working one i checked it in phpmyadmin + it shows what it need to show in the index.php if i comment the "or die(mysql_error()) " here the sql when its do echo SELECT userid, caption, stamp, filename FROM photographs WHERE userid in (4,7,2) order by stamp desc limit 5 so y the hell this problem is keep coming? i really cant understand what wrong! :-\ tnx for the help!