Skip to content
Advertisement

Tag: insert

Call to a member function count() on null

When I’m going to add data an error appears “Call to a member function count() on null” View Controller rekap: but the data is successfully entered into the database, and what steps should I take to correct the error Answer error tells you that images or files or both variables are null, looks like you don’t use eager loading quick

PHP MySQL GET RESULT from INSERT INTO IF NOT EXIST

I know how to do INSERT INTO if the record doesn’t exist. But if it does exist, mysql doesn’t treat it as an error. It just treats it as 0 rows inserted. I want to know if that was the case and return that message to the user that the data they submitted already exists. I know I can do

if enctype setting is not correct, photo is not inserted through php file however other data can come through

h hi I want to insert data in database included photo. also after inserting in database, image should come to a web page. it get inserted in database but I get the following warning when I want to see it in a web page: Warning: Undefined array key “photoPath” in D:xamppweekendhtdocsworkdelivercweb7ForServer3insertItem.php on line 30 Warning: Trying to access array offset

Check for duplicate emails before querying

I’ve searched and look at other examples but as i’m new i’m having trouble translating over to my code. What I want to do is have it check the database to see if that email has already been entered. If it has I want it to tell them it has and that there is only one entry per person. Any

PHP MySQL Insert Ignore Inserting Too Much Data

I have a traffic exchange and every time a site is viewed I want it to insert in to a table which looks like: -user -site The user is default of 1 and I don’t insert in to it because I thought for an INSERT IGNORE you need a column that stays in the same. My current query: I have

MySQL INSERT IGNORE INTO keeps adding duplicate entries

Here’s the particular area im having an issue with when testing this it keeps adding the same entry to the table even though I have set IGNORE INTO. Answer It looks like you don’t have a UNIQUE INDEX on the IP column. In order for INSERT IGNORE to work as required, that’s neccessary. Try this; ALTER TABLE ip ADD UNIQUE(ip)

Advertisement