Skip to main content

All Questions

Tagged with
0 votes
3 answers
4k views

Insert multiple rows to database from HTML form containing repeated fields using MySQLi

I'm trying to make a form that uses arrays so once it is submitted and processed multiple rows get inserted into my database. My main program is more complex than below but I could not get it working ...
Smush's user avatar
  • 89
2 votes
2 answers
2k views

How to prepare SQL query dynamically (column names too) avoiding SQL injection

I recently learned about SQL Injection and the PHP recommendation to avoid it, using prepare() and bind_param(). Now, I want to prepare SQL queries dynamically, adding both column names and values. ...
Nicolás Bustos's user avatar
-1 votes
1 answer
3k views

How can I create a dropdown menu to search my MySQL database?

I have to create a search form to retrieve data from a MySQL database. I used this to create a dropdown selection of one category. It does work, and the menu is clearly linked to the database, because ...
haf's user avatar
  • 15
8 votes
3 answers
750 views

Errors appearing in mysqli code and call_user_func_array() [duplicate]

I am getting quite a few errors when trying to create a dynamic where clause using mysqli: Warning: Parameter 2 to mysqli_stmt::bind_param() expected to be a reference, value given in ... on line ...
user1914374's user avatar
  • 1,250
0 votes
2 answers
250 views

Insert one or more rows into database from a dynamic form containing repeatable and non-repeatable fields

This is my second post on the same issue, in my first post I was using mysql instead of mysqli so I have made some updates according to recommendations. I have a form with variable sets of fields (1 ...
Pari Baker's user avatar
13 votes
2 answers
86k views

Send html form data to sql database via php (using mysqli)

I want to send the data inputted into an html form to my sql database, i.e., create a new row attributing certain values to certain columns. I know there are similar questions, I read the answers but ...
Alex's user avatar
  • 1,446
2 votes
2 answers
3k views

Search mysqli table with form and display results

I'm searching a table with a form where the result could be from any of the 3 choices (cata, catb or catc) and then display the results, however my error warning keeps popping up and can't display the ...
Tatters's user avatar
  • 1,197
2 votes
1 answer
1k views

SyntaxError: "JSON.parse: unexpected non-whitespace ..." when returning JSON from PHP [duplicate]

I'm running into an issue where the JSON returned from a PHP query is not valid and I'm not really sure why; I'm still learning. When the datatype is excluded the below code returns: {"Customer_ID":"...
artomason's user avatar
  • 3,853
2 votes
2 answers
1k views

Automatcially check checkbox based on database array PHP

In the "User Setting" tab of my page, I want the user to determine which types of posts from a specific user. Here is the form: <form method="post" action="" name="permitted_categories"> ...
Aaron Barksdale's user avatar
2 votes
1 answer
4k views

Retrieving Data from MySQL - only logged in user

I am building a new project right now and finished my login/registration script. It is working so far but now I need a new function and I am not sure how exactly I should do that. If a user logged in ...
Christoph C.'s user avatar
1 vote
1 answer
7k views

Show data pulled from database, based on html form input and display in html page

I have a html page with an input box. I am trying to retrieve data from the database based on that input and send it back to the original html page in the form of a table using php. I created the php ...
A.B's user avatar
  • 23
1 vote
2 answers
8k views

PHP Multiple input search

I'm currently working on a bit of PHP and I've 3 text inputs. The values are searched in the MySQL database and should return whatever amount of results correspond with the entered criteria. here is ...
Andrew Glass's user avatar
0 votes
2 answers
294 views

Nested while loop runs only once [duplicate]

Nested "while" loop runs only one time, only one div is displayed, can't find any mistakes, 0 errors in "error_log". Feel free to suggest. I need second sql connection, because $connectToStore makes ...
EasternEuropean's user avatar
0 votes
1 answer
692 views

How to call 2 stored procedures using mysqli

Bascially I have a form with 2 select dropdown boxes and I want to populate the selections with 2 stored procedures that returns all the values via php. However, it seems like only the first select ...
ygongdev's user avatar
  • 284
0 votes
1 answer
657 views

How to get rid of extra line breaks on top of table created with PHP?

I am just starting coding in PHP. I am experiencing a problem that I am not able to solve with any solution I found on the net. I am trying to show a table with the threads that have been created on ...
Richard Steele's user avatar

15 30 50 per page
1
2 3 4 5