![]() |
How to write this
Given something like
PHP Code:
PHP Code:
|
Why don't you try it? ;-)
|
Quote:
PHP Code:
|
Quote:
|
Quote:
Quote:
The reason I told you to try it was because I've seen people(including myself before) ask things they can easially try out on their own(trial and error is the best way of learning). If you've tried it, that's great. For the record, I've tried that too a long time ago(or something similar) and it doesn't work. |
Quote:
Quote:
PHP Code:
PHP Code:
|
Hm. Exactly why do you insist on having it on 2 rows instead of 3?
|
This is where a good database abstraction layer (or class) comes in handy. If you really want to simplify it down to one line create a MySQL class or use someone else's. You could even just create a single function to do this:
PHP Code:
|
I was setting up up some test code and got tired of typing in two lines. I wouldn't use in the live code I work on. It seemed an obvious thing to combine the two but when I tried it, it didn't work. I've found in the past that learning how to do things like this helps me understand other problems I may encounter later on so I wanted to learn how to do it to further my understanding of php. But since no one knows how to do it, I'm beggining to think it isn't possible.
|
It's possible, but doing so could/can/will cause errors/troubles down the line.
|
Please show how to do it. What sort of problems?
|
Quote:
I would suggest something similar to what ETbyrne wrote above, it solves the solution and provides it in a function for reusable purposes. |
You should really be playing around with this and figuring these things out yourself. You will learn a lot more that way.
|
I have. I tried every variation I can think of. The solution may be something obvious but it is beyond me at this point, which is why I posted here. Am I missing the point of this forum?
|
| All times are GMT. The time now is 01:38 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0