Skip to content
Advertisement

Tag: php

Is this code protected for SQL injection?

is this safe enough? Or should it be improved? Is this code protected for SQL injection? (PHP) Answer I take it for granted that $wpdb is from the WordPress project. Then as explained by the documentation, the very purpose of these placeholders is to prevent SQL injections. Hence you can consider your code safe against SQL injections. Personally I like

Can I use DECLARE as an SQL statement in PHP

I am trying to execute a query in PHP, but this code wouldn’t work for some reason, it doesn’t detect the keywords at all(DECLARE, SELECT, WHERE). Is there anything I can do and after all can I even use DECLARE in PHP as a mySQLi statement. $sql2 =”DECLARE @MaxID INT; SELECT @MaxID = MAX(productID) FROM products; UPDATE sunglasses SET sunglassesId

Loading table values into a poplist, current value displaying correctly

I have two tables in my library database, Books and BookTypes: When I load the Edit screen from my search results page, I have got the three types displaying. But can’t get the currently selected value of the book to display(It’s always Digital). My Edit Page Code is: How do I ensure the current value of the selected book’s booktype

Display each sql db row in a single php page

I’m trying to display each single row from my db as a separated unique page, so when I click on the row link (which I don’t even know what it is until now) it directs me to a new page with the content of this row or some of the content as I desire.. So I created a new php

Issue with uploading image using this.form.submit();

I am using this.form.submit(); in order to upload an image straight after it is sellected and also pass some other info along. I am having an issue, the submit works and passes the id with post but the image is not uploaded and the name is not inserted in the db it might add a name like 0_ but that

Advertisement