
DaveyK
Members-
Posts
289 -
Joined
-
Last visited
-
Days Won
1
Everything posted by DaveyK
-
$rs_city = mysql_query($query_rs_city, $dbconnect) or die(mysql_error()); $data = array(); while ($row = mysql_fetch_assoc($rs_city)) { $data[$row['country']][] = $row; } print_r($data); Try that
-
Well, you can also try to improve your skills, but yeah, buying a theme is the easiest way out.
-
Keep in mind that MySQL is deprecated as of PHP 5.5.0 (that means its no longer supported and will be removed in th future). Instead, the MySQLi or PDO_MySQL extension should be used. If you still have the shot the use a future proof SQL class, take it now.
- 18 replies
-
- configuration
- php
-
(and 2 more)
Tagged with:
-
Ask yourself if its worth the insult and keep privacy in mind. Also, cant you moniter the internet connections?
-
As haku said, even if you call your PHP script, it wont return any PHP but rather the result of said php. So if your php file returns html, the JS will ONLY see the html.
-
Are you sure images are required? You can do a bunch with CSS (seriously, a lot). Images will slow down and keep in mind: the user will see them load which is kinda ugly, right. Also, with CSS you can change the backgound-image on :hover. Needless to say, you can also use images and still keep to pure CSS
-
How is this for starters? // Max Target dimensions $max_width = 1550; $max_height = 620; $max_size = 2048000; // 2000 kiloBits * 1024 = 2MB (MegaBytes); // Min Target Dimensions $min_width = 400; $min_height = 350; // Get current dimensions $old_width = $info[0]; $old_height = $info[1]; // Define the scale thats most relevant (so wide images scale in width and high images scale in height) $scale = min($max_width/$old_width, $max_height/$old_height); $new_width = ($old_width > $max_width) ? round($old_width * $scale, 2): $old_width; $new_height = ($old_height > $max_height) ? round($old_height * $scale, 2): $old_height; Its not a complete script, but it does calculate the new height. From what I understand you want to cut it from the center? Then why bother scaling it?
-
Creating loop to send sms more than one recipient
DaveyK replied to xmuzukerx's topic in PHP Coding Help
You can imagine that, if someone were to send a string instead of a number, you would still attempt to send a text to that string, and that would be a bad sitaution, right? -
Creating loop to send sms more than one recipient
DaveyK replied to xmuzukerx's topic in PHP Coding Help
Just tell us what the error is -
You dont need a script to handle :hover and :active events, you can just style it in css.
-
Post the relevant code in code tags rather than posting the files, please.
-
I was gonna suggest imagecreatefromstring but Barand beat me to it. I dont know anything about it, but you can give it a shot right
-
Well, I personally like to calculate the full dimensions of the to-be-created image before running the actual creation of the image. What you first need to know is... is the source image always going to be same size? (So always 500x300?)
-
What is you ask? Do you want to know if PHP can read a .pix and convert it to jpg or something?
-
As you mentioned, you are looking for guidance. BogaZonde guided you in the right direction, the function does the logic but doesnt return anything. Do you know how to proceed from here?
-
When possible I would use small sections of images for web design or even just use as much CSS as possible. Just looks better. Besides, all elements have purposes and I'm not too familiar with html5
-
How does it not end up like you want it to? I understand that certain layouts have function or structural boundaries but you are still sole responsible for your own designs and "them not turning out the way you hoped" is something you chose to do, in my personal opinion. I personally work a lot with <div>s, but who doesnt.
-
Please put your code in BB code blocks. What have you tried so far to achieve what you describe?
-
well, your name says lazy so we shouldnt be surprised. Why are you asking if you miss when you can also add it in and test for yourself. We are not here to give you all the right answers. We are here to guide you in the right direction.
-
You are right. My own data is kicking my butt. Well okay then, here's an example... Keep in mind that the data below is a comment section in a blog. The easiest method is obviously comments with 0 levels of replies Post1 Post2 Post3 Post4 Ideally, I would like N levels of replies. However, it was decided to allow 1 level of replies. Much quicker and easier, so: Post1 .. Post 5 Post2 Post3 .. Post 6 .. Post 7 Post4 Now what you obviously need with replies is a reply link (?reply_to=ID), but I only wanna show them once for every 'post'. I don't know how to explain this, but here it goes. The reply link would show up: Post1 .. Post 5 <-- here Post2 <-- here Post3 .. Post 6 .. Post 7 <-- here Post4 <-- here Again, this is easy for post 2 and 4, but for post 1 and 3 I need to know the id, but th problem I was facing was that I was already at array key 5 (post 7) whereas I need the ID from array key 3 (post 3). I have it working without any known bugs, but I am open to suggestions... Thanks for the help and the useful discussion anyway. PS I realize that this could also be done in CSS but I accepted the challenge in PHP. The first data set is wrong because I didn't have it working yet with the reply ids then so I wasn't organized at all
-
To be completely honest, I just checked my codes and I use a delete query one time, to delete an instance of an image if it somehow didnt get uploaded. Other than that, I am using status columns to mark things as deleted.
-
if the *_query() fails I wont even run *_affected_rows().
-
Performance wise, I wouldnt know what the best thing is. But im guessing that the extra query counts more heavily then *_affected_rows().
-
I personally always run a DELETE query, but I'm interested as to how others (better programmers?) do this. When I need to let the user if the delete was a success, I check *_affected_rows(). If thats 0, the *_query() would still return as if it was a success. If affected rows returns 0, it means the delete didnt actually occur. Just the way I tried it. Mostly because I thought it makes sense, I'm no pro.
-
You will find that we are more willing to help if you are putting effort in it yourself.
- 4 replies
-
- javascript
- php
-
(and 2 more)
Tagged with: