Skip to content
Advertisement

Tag: php

PHP Loop through results

I am trying to loop through my database and check to see if the user already exists in another table. If they do then I want to increment a value, if they don’t then I want to add the user. When I run the code below it happily loops through all the results: However when I add in the SQL

How to Update new tables inside another update query?

I have a legacy system and i have a php file inside of it, updating one table. Now i added a new table to my db and i want to update that table too. The problem is that (for some reasons) i cannot use another query and i have to change the current query. simplified former query: $q = “UPDATE

One table with many field or two table with fewer fields?

My question is simple, currently, I have a database with an “User” table which contains important information about each users (email, username, password), an “Identity” table which contain the first name, last name, birthday… of an user, and a “Medias” table which currently contains fields like “facebook”, “googlePlus”, “twitter”, “youtube”… the address of all medias of the user actually. But,

PHP Prepared statement bind_param() error

Many people on stackoverflow has had this problem, but i still cannot spot the mistake This is the error: This is the lines of code: Answer After every mysqli or PDO function that COULD return a bad/failed status you must test for that possibility. The error Fatal error: Call to a member function bind_param() on boolean says it all. $insertpost

How to display query results in php

I know how to make a set query display, but I need to take an input, run a statement, and display the result. Here is what I have: HTML: PHP: I also want to make the statements read only so nobody can mess with my tables. im a little new to this i might need some extra explaining Answer To

MySQL rows checksum

Is it possible to select entire row in a table and get sort of checksum? I am looking for a way to tell my code to update data only if at least one record has been changed. From perspective of data …

Advertisement