dannyb785
Members-
Posts
544 -
Joined
-
Last visited
Contact Methods
-
Website URL
http://www.dannybianchi.com
Profile Information
-
Gender
Not Telling
dannyb785's Achievements
Member (2/5)
0
Reputation
-
Best way to grab all info from one mysql row?
dannyb785 replied to dannyb785's topic in PHP Coding Help
I have no clue what Assembler is. I googled it and none of the results seem to be related to what I was asking. Can you expand your answer so it's actually helpful and not a waste of space? -
Best way to grab all info from one mysql row?
dannyb785 replied to dannyb785's topic in PHP Coding Help
Praise Allah! Finally a response that was helpful. Thank you lemmin, you've restored my hope in this website -
Best way to grab all info from one mysql row?
dannyb785 replied to dannyb785's topic in PHP Coding Help
Your response of "no" was CLEARLY being sarcastic at my frustration. -
Janj, are you saying that on your website, [redacted], that your browser isn't displaying the image? It is displaying correctly for me. Are you using a really old browser maybe that can't display png's?
-
.htaccess not working, what am I doing wrong?
dannyb785 replied to ballhogjoni's topic in Apache HTTP Server
Have you tried it without the / in front of path? But I don't know your folder setup so that might not be helpful -
I'm with lemmin, I read your question and the code over a few times and I'm not sure what you're trying to do. I understood that you wanted to count the number of files in the folder, and then something about the image type(like jpg, bmp, etc?)
-
Hello, I seem to have had bad luck in getting any helpful answers for my last 2 threads so if you don't want to help, I'd rather you just not reply, but here goes: There are times when I need a list of users to be displayed and then a set of checkboxes next to them, where each checkbox represents something different. As an example, an admin page wants a list of users in a table and in each row, there's a checkbox for "admin"(to choose if that user is an admin), "suspended"(if that user is suspended), and so on. I initially thought that I would just scan each row and those that were checked, it would mark that value in the user table to 1(indicating that it was checked), but then I don't know how to detect a checkbox that was left unchecked. Sorry if my question doesn't make sense, so if it doesn't, I guess an easier way to ask is: how do you detect check boxes that weren't checked?
-
That doesn't answer any part of my question. I can tell that you enjoy being vague in your posts, but why even reply if you're not going to help?
-
Best way to grab all info from one mysql row?
dannyb785 replied to dannyb785's topic in PHP Coding Help
I also didn't realize this forum was so full of pompous, arrogant coders who feel like my questions aren't worth their time. I didn't think I'd have to give an example but here you go: A user logs in and I store their user id into a session variable. Then, any time they're on a page that requires their own information(like an 'edit my account' page or something), I run a quick query to grab the row in the User table with that user id that was stored in the session variable. It's a value that will never change, no matter what the user does. So I can know for 100% certainty that the value given will be an integer and will be a number that exists in the User table. Is that a sufficient enough example of how I can know for certain? -
Best way to grab all info from one mysql row?
dannyb785 replied to dannyb785's topic in PHP Coding Help
Jessica, your signature says that instead of giving answers to questions,you give hints. But just saying "it's not efficient" isn't helpful in the slightest. -
Hi I can't seem to find an answer anywhere else so I hope someone can give some insight. I'm not looking for actual code, just an example of 2. I've written a few social networks in the past, mostly for fun. But the newsfeed part always tripped me up. I started off by making a database table called "Newsfeed_Post" and each row would have a set of info that explained what the newsfeed post was for(events, pictures, etc), which user did it, etc. But then when I got to the part where I wanted to grab the last 20 posts that were relevant to any particular user, that's where I'm worried about my mysql queries. I understand about JOIN's and whatnot, but if I wanted the option to show the newsfeed updates for users who were a: my friend b: not suspended, c:not hidden(since you can hide a friend's post), etc, that would produce quite a few WHERE conditions, which were very resource-heavy. So all I'm asking about is the concept behind popular newsfeed, we can maybe say facebook for example. I'm not asking how facebook does theirs(obv we don't know) but I'm asking how could facebook(or other social networks) do a newsfeed system that doesn't include a whole bunch of WHERE conditions? Or is it just not possible? Or was my whole idea of having a separate "Newsfeed_Post" table a bad idea? If so, please explain why it's a bad idea. I'm just looking for concepts/idea and possibly the pros/cons for each, if you wish to explain them.
-
Best way to grab all info from one mysql row?
dannyb785 replied to dannyb785's topic in PHP Coding Help
Why won't anyone just say yes or no that the code I provided is efficient or could be made more efficient? Does it use up too many resources to use extract()? Should I avoid using it? I'm not asking for real-world coding. I have my own reasons for being certain that the data in the query won't produce a result. All I'm asking is the quickest(and least resource-heavy) way to grab data from mysql and store it into variables. -
Best way to grab all info from one mysql row?
dannyb785 replied to dannyb785's topic in PHP Coding Help
I don't think my original question was clear. I wasn't asking if the code was best for validation or anything like that. My question was concerning its efficiency. Let's pretend that you knew for a fact that the query would generate the one row for the id given, and that there were no errors, is this the most efficient way to do that? Or is there a better way? I know that I don't really have to extract(), so I'll just reword the line in question: mysql_fetch_assoc(mysql_query(" ANY QUERY THAT WILL ONLY GENERATE ONE ROW ")); In terms of using up server resources, is there a more efficient way to generate the result than that? Can you kindly give an example of a line of code that would be less "terrible" ? -
Hi all, Since I first started coding php, if I was ever grabbing one specific row(usually based on the primary key so it was unique) I've always just done: extract(mysql_fetch_assoc(mysql_query(" SELECT * FROM User WHERE user_id='1' "))); But I recently thought to myself, is that the wrong way to do it? Is there a problem with doing that? Or is there a more efficient way to grab all of the data from one row?
-
Loop To Extract Images, Causing 'internal Server Error' ?
dannyb785 replied to dannyb785's topic in PHP Coding Help
I'm not using CURL, but I guess your suggestion is still similar. The server I'm moving the images to is a client's server so I don't know what his options are set to, but is there a way to prevent a timeout? I was thinking maybe just a cron job every 2 minutes to grab a few images and just let it run all day. Is that feasible?