-
Posts
24,563 -
Joined
-
Last visited
-
Days Won
822
Everything posted by Barand
-
Why the two queries when the first set of results is just a subset of the second?
-
I haven't a clue. Imagine I am not psychic and cannot see your screen or your current code.
-
It's one way. IMO< Your original use of <a>...</a> links is probably more common. You can always style the links to resemble buttons. Also, as all you are doing is GETting a new page of data, the convention is to use GET and not POST method. Use POST when the form action causes change - such as logging in or updating a database.
-
You old query stored its results in $sorgu. Your new paginated query stores its results in $result. You need to adjust the code accordingly.
-
When it comes to SQL injection, stored procedures and prepared statements both do the same thing - they separate the data values fron the query statement. The mechanisms are slightly different, however. With prepared statements, placeholders are used instead of the data, and the values are passed at execution time. With stored procedured, the values are passed as input parameters when the procedure is called. Using both is a "belt and braces (sorry, suspenders)" approach. The advantage of a sproc is it is pre-written and stored (clue is in the name) waiting to be called so there is no overhead of sending the query statement - you just send the data. If you use "dynamic sprocs" you throw away this advantage. To me the idea of a "dynamic sproc" is oxymoronic, like military intelligence, internet privacy, common sense.
-
-
I was in my fifties when I first came across something called HTML. I knew Basic from from my days with a BBC home microcomputer so I started using Visual Basic to create web pages. Daily, I would log in to the Compuserve Bulletin Board using my dial-up modem to exchange ideas (much like now - plus ca change, plus ca meme). I started to write Java applets to enhance my pages but, no sooner had I started to become reasonably proficient, the world switched to Flash (which has since died a death). Disheartened, I let the Java lapse. One of the biggest mistakes I've made as today's phone apps are essentially Java applets. A year or so later I came across PHP and much prefered its Java/C type syntax to Basic. My preference was cemented when I discovered that rewriting my VB/ASP scripts in PHP gave me a 3x+ speed increase (in one case a 70x increase in performance as VB was crap at handling long string concatenations). Anyway, the moral is "You ain't too old".
-
Also, don't run a series of chained queries where you use the result of one query to determine the records selected in the next. Instead use a single query with JOINs SELECT um.id , um.username , um.lastname , bs.slot_id , bs.slot_date FROM usermanagement um JOIN booking_reservation br ON um.username = br.reservation_name JOIN booking_slots bs ON br.slot_id = bs.slot_id ORDER BY um.username, bs.slot_date
-
Yeah, but he needed to have it pointed out in a picture where he went wrong. I can do that now he finally deigned to show the output code.
-
@maviyazilim you are always outputting the last 10 in descending order. You should be outputting the results of the paginated query
-
non-English language issue in creating php array from CSV file
Barand replied to thara's topic in PHP Coding Help
What charset is the google one using? -
The variables $greeting and $late do not exist within the function. You will need to pass them as arguments or define them within the function.
-
non-English language issue in creating php array from CSV file
Barand replied to thara's topic in PHP Coding Help
Yes, but what charset is the CSV? Also, does this apply to your setup (from str_getcsv in manual) -
non-English language issue in creating php array from CSV file
Barand replied to thara's topic in PHP Coding Help
Was the csv created using utf8? -
non-English language issue in creating php array from CSV file
Barand replied to thara's topic in PHP Coding Help
Have you specified a compatible charset for your page, such as UTF8? -
Not unlimited though
-
As you have not shown us this homepage (where the error is showing itself) then you have had us chasing our tails and wasting time on the wrong piece of code. I've had enough. If you're lucky, someone else might take over. Bye.
-
Are you telling us that the code you posted here is not the code you used to output the list?
-
Despite requests, you refused to show any code that output the query results. On top of that you used "SELECT * " which gives us no information whatsoever about the columns you are selecting. As I told you, I created a test "icerik" table. This had columns "icerik_id" and "name" - which is why I output a column called "name". You need to use your column names, whatever they are.
-
Help with depreciated 'each' function replacement
Barand replied to sks2416's topic in PHP Coding Help
I've seen lots of images with captions. I've also seen lots of images with a caption and a sub-caption. What I haven't seen are images with a caption, sub-caption, sub-sub-caption et al. Perhaps naming the columns "Caption" and "Subcaption" (without the number suffices) will allow you to sleep tonight -
Help with depreciated 'each' function replacement
Barand replied to sks2416's topic in PHP Coding Help
I knew when I was writing that there would be some purist raising an objection. However I decided the returns in this case weren't worth the extra effort and took a pragmatic approach. -
Help with depreciated 'each' function replacement
Barand replied to sks2416's topic in PHP Coding Help
+1 to the bad DB design. Instead of +-------+-----------------+------------------------+------------------------+ | id | image_url | img_cap_1 | img_cap_2 | +-------+-----------------+------------------------+------------------------+ | 1 | imgA;imgB;imgC | capA_1; capB_1;capC_1 | capA_1; capB_1;capC_1 | +-------+-----------------+------------------------+------------------------+ you should have +-------+-------------+---------------+--------------+ | id | image_url | img_cap_1 | img_cap_2 | +-------+-------------+---------------+--------------+ | 1 | imgA | capA_1 | capA_2 | | 1 | imgB | capB_1 | capB_2 | | 1 | imgC | capC_1 | capC_2 | +-------+-------------+---------------+--------------+ -
Help with depreciated 'each' function replacement
Barand replied to sks2416's topic in PHP Coding Help
Use foreach()