Skip to content

Tag: mysqli

Dynamically generate type definition string for prepared statement

I’m working on a script that is essentially loading data from an API into a local MySQL database. The values are variable depending on what is returned by the API. So far everything is working just fine up until I try to actually insert the rows into the MySQL db. Specifically, I know I should be using prepared statements, but

Display related posts from the same category. Using PHP and MySQL

I have a blog site in PHP and MySQL with tow table, POST and CATEGORIES. I need help, how to display related post from same category when visitor clicked on a single post title. your help will be greatly appreciated POST table POST_ID CAT_ID TITLE DESCRIPTION IMAGE 1 3 2 5 3 1 4 6 CATEGORIES table Cat_id Cat_name Total_post

Update specific row in MYSQL [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed last year. Improve this question In

mysql query in procedural php isn’t returning single field

Trying to retrieve a single field from a mysql table. Here’s the PHP: I then use ajax to retrieve $sigDAT Ajax returns the following result for $sigDAT: [object Object] Ajax returns $signatureDAT (the original data) correctly. $sigDAT and $signatureDAT should have identical value, so I suspect the problem is in the “RETRIEVE” section of code. Answer To answer your question,

PHP form validation not functioning having copied the tutorial code

I am hoping the community can give me a little insight into what is not working with my code, I am following a Udemy course. I have followed the accompanying video which developed an undefined variable error, which after doing some research I believe I have fixed by declaring variables as empty strings being able to be over-ridden by the

My mysqli statement is not storing any data

As a part of my training, my team leader asked me to make a simple login in PHP, I have created a controller that receives the username and the password from a JavaScript file, and then triggers an SQL query using parameters, that’s where my first problem starts. I execute the statement but then I can’t manage to store the

Data from 2 tables is not displaying on the same page

I’m a newbie in PHP and mySQL, I’m currently working on a profile page where I will display the logged in user’s personal information from one table called users and also display the tours that they will book in the future from my website from this table: booking I’m fetching the data from users table with prepared statement which will

MySQL returns wierd result with normal query

So I have this code: And it returns this instead of the normal values in the table: array(12) { [0]=> int(2) [“ID”]=> int(2) 1=> string(7) “anderes” [“Naam”]=> string(7) “anderes” [2]=> string(4) “0.00” [“Beschrijving”]=> string(4) “0.00” [3]=> string(4) “0.00” [“Prijs”]=> string(4) “0.00” [4]=> string(0) “” [“Prijsweergave”]=> string(0) “” [5]=> int(2) [“Termijn”]=> int(2) } This is the table: Answer I assume your