Larry
Administrators-
Posts
5413 -
Joined
-
Last visited
-
Days Won
155
Everything posted by Larry
-
insert query
Larry replied to Priyam's topic in PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (5th Edition)
Basically that just means your query failed to run, which means the database spat out an error instead of any results. -
A CSS Issue
Larry replied to JohnIat's topic in PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (5th Edition)
Ah, sorry about that but kudos for figuring it out and thanks for letting me know! -
This kind of problem is a PITA to debug b/c it could come from several places: the value stored in the database, the value retrieved from the database, the value put into the HTML, or the value displayed in the browser. I don't think you want to go to some converter method; it's best to solve the actual problem. I'd start by confirming how the values are stored in the database. Make sure the database is using UTF8 everywhere, especially on the specific table and column. Make sure you're using UTF8 when connecting to the database, both directly and from PHP. And then make sure your HTML page uses UTF8, both in the HTML encoding and in the encoding used by your IDE/text editor when saving the file.
-
Sorry about the delay and thanks for reminding me! The solution here isn't immediately obvious so I had to hunt around a bit. It looks like the write session function is what comes into play here (per the PHP manual), but that method returns true, assuming we're looking at the same script. This is a wild guess, but does it get fixed if the close session function is changed to mysqli_close($sdbc); return true;
-
Scan image
Larry replied to olaoyesunday's topic in PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (5th Edition)
I don't know the answer to this one off the top of my head. You might be able to use imagmagick or gimp? I really don't know whether this would qualify as OCR or not? I imagine you'll need to find some software that runs on the server that can do the work, then upload the image via PHP and call the software via PHP through an exec() command. None of this would be easy or obvious. If you already have a JS library that works for the reading of the image, can't you just have JS do the math, too? -
STRIPE Capturing Charges
Larry replied to Necuima's topic in Effortless E-Commerce with PHP and MySQL (2nd Edition)
To clarify, the chard ID is not the same as the token. The token is the representation of the payment method, which is used to create a charge. As for not seeing the charges in the Dashboard, you are looking at test data, which should show the results. I'd look at the logs in the Dashboard to see if requests are being made and also confirm you're using the right API keys. -
Chapter 15 Stripe
Larry replied to Necuima's topic in Effortless E-Commerce with PHP and MySQL (2nd Edition)
I expect the problem is you CANNOT test from localhost without SSL. If you use Let's Encrypt, you can get a free, legit certificate to use for testing purposes. -
Stripe - Not Receiving $_POST data
Larry replied to Necuima's topic in Effortless E-Commerce with PHP and MySQL (2nd Edition)
Ah, okay. Kudos for figuring it out and thanks for letting us know! -
I forget if I have examples of this in the book--I suspect I do--but here's an explanation of options for you that should work: https://stackoverflow.com/questions/11693234/php-mysql-gets-value-of-out-parameter-from-a-stored-procedure
- 1 reply
-
- stored procedure
- pdo
-
(and 2 more)
Tagged with:
-
Search engine
Larry replied to Ray G's topic in PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)
If you look at the SQL chapters you'll see examples of how to do fulltext searches in MySQL.- 1 reply
-
- view user
- search engine
-
(and 1 more)
Tagged with:
-
Typo in Chapter 6 Page 135
Larry replied to Andrea's topic in PHP for the Web: Visual QuickStart Guide (5th Edition)
Thanks for reporting that! I'll have the publisher fix it. -
Yes, more or less. You'll want to change your naming scheme so that each row of input--which becomes a database row--ends up as part of the same array in PHP. You'll need to play around with what works, but if you do var_dump($_POST) in the PHP code that may help you understand what's coming in from the form.
-
Related to pcre
Larry replied to vikky's topic in Effortless E-Commerce with PHP and MySQL (2nd Edition)
This is very good detective work and thanks for being so thorough. I'd start by ruling out cases 3 & 4, though. The links are going to come through with HTML entity versions, so %26. You'll never have & in the URL, so there's no need to test and handle that. I'm also not inclined to go to zero-width positive lookahead assertions; that'd probably just complicate things. I just did an online regex tester for case 2 and it matched the percent okay: https://regex101.com/r/AWJdX3/1/ Are you restarting Apache after making changes to the configuration? -
Okay, so this kind of thing is a bit tricky. Since you have multiple inputs that are all arrays of related records, I'd start by changing your naming scheme to make them all more overtly related. For example, you'd want exams[X][subject] and exams[X][grade]. If i'm following you on this. I'm not sure I am 100%. But the key is to make the association of the data overt like that. Let me know if it's still unclear.
-
Chapter 8 CSS not showing proberly
Larry replied to Niels's topic in PHP for the Web: Visual QuickStart Guide (5th Edition)
The browser just isn't finding the CSS file, which means the HTML reference to it doesn't match where the file actually is. Do you have a CSS folder with the correct CSS files in there? Like this: https://github.com/LarryUllman/phpvqs-5ed/tree/master/08