Skip to content

using “INSERT INTO” statement in php code doesn’t work

I’m trying to build a database for a bookstore with 3 tables: Book, Volume and Publication. I’m using mysqli() and the code neither works nor echoes any errors. Answer The problem is that you are checking with === TRUE. As PHP Manual says: Returns FALSE on failure. For successful SELECT, SHOW, DES…

How to output decimal numbers in PHP?

I’m trying to pull two numbers from a variable($text) and then multiply them and output the results. The two numbers can be ints and floats. When I try: $text = “1 photograph – b&w – 2 x 5 …

PHP: Generate unique random int number based on an id

I’m currently searching for a good way to generate a unique random number for SEPA transactions (End-to-End reference) with 27 digits in PHP. My requirements are: Must be unique Only int values, no letters Length of 27 digits Use an user id and time to make the ID unique I’ve tried this solution h…