AyKay47
Members-
Posts
3,281 -
Joined
-
Last visited
-
Days Won
1
Everything posted by AyKay47
-
While convention has you list the column first, it will work either way. learned something new then
-
Bottom line, don't worry, you will never reach that amount.
-
They have many servers for there information.
-
Make a pic from a directory clickable to a url from my database
AyKay47 replied to hotmert's topic in PHP Coding Help
what exactly does $row['url'] contain? you should get into the habit of using full <?php ?> tags, as not all servers are enabled for short tags. what does a view source in the browser show? -
i actually commented on the same error in another one of his threads. Kleb, please do not post multiple threads on the same topic.
-
css will work, however it depends if you want the image to change dynamically or statically. there are several factors that will go into determining if simple CSS is right here.
-
post your code directly onto this thread, very few people will download a file given from a user.
-
won't write the code for you, but I will explain further what I am saying. you state that your field names for the table in use are 'uid','uname','pswd','user_type'. now in your query, you are wanting to select data where the field login = $uname and the field passwd = $pswd. my question to you was where did the "login" and "passwd" fields come from that you have specified in your query?
-
What may be the other filtering ? The one I m doing is not enough ? By mime types I think you meant "mime_content_type()" ?? Size, possibly name, and making sure that $_FILES[]['error'] is clean as it states in the link I gave you. For basic mime filtering, yes, however I normally like to group the valid mime types into an array and compare the array to the $_FILES[]['type'] value, saves some coding. mime_content_type will return a string containing the mime type of the file yes, but that function is not needed here since you are already checking the mime type via comparison operator.
-
the field name needs to be before the value. $sql="SELECT post_comments FROM post WHERE $topicid=topicsID"; // reverse $topicsID and $topicid $sql="SELECT post_comments FROM post WHERE topicsID = $topicid"; //correct
-
Where is the variable "i" defined in your code? You will want to add the imgs/ directory before each one of your imgList values.
-
The error means your query is invalid, if those are your field names, why have you specified different ones in your code?
-
well, yeah I suppose, I'm not a fan of order by rand(), however technically in this case it will work and shouldn't affect efficiency.
-
on second thought, after looking at the OP again, the original sql statement that you have will work, if you are only worried about updating one random field. <?php mysql_query("UPDATE systems SET id= '".($_SESSION['user_id'])."' , owner = '".($_SESSION['user_id'])."' WHERE id = '' ORDER BY RAND() LIMIT 1"); ?>
-
Writing and Reading an associative array to file
AyKay47 replied to possien's topic in PHP Coding Help
yes, use serialize to convert the array to a string for db storage, then unserialize to convert it back into an array after selecting it form the db. -
rand what is the point of the first query?
-
you most certainly can filter data with javascript, however it is not advisable because the user can disable javascript, thus disabling your js filtering. If you are going to go the javascript route, make sure that you have some back end code that will check the user input as well.
-
Writing and Reading an associative array to file
AyKay47 replied to possien's topic in PHP Coding Help
imo I would use a database for this along with serialize and unserialize. -
you will receive more help if you post the code directly onto a thread, very few people are willing to download files from someone else.
-
if you are filtering the results to only allow image mime types, along with some other filtering, your code should be pretty secure. take a look here
-
it is the appropriate function, the second parameter of preg_replace() is for the replacement of your pattern, so $somevariable will be whatever you want to replace [!gallery!] with.
-
Only if it's called after the external css file. yeah, css code is parsed top to bottom. unless "!important" is used.
-
no, you said "Try this:" which doesn't teach the OP anything. I said in english what you wrote in code.
-
your pattern is fine, where is $somevariable coming from?
-
well it really depends on how big your data set is. For larger result sets, order by rand() is very inefficient compared to alternatives, for smaller sets, you can get away with it but I still don't recommend it.