Tag Info

New answers tagged

0

I get this effect only when applying a query. A table, view, or other direct structure seems to export into SQL fine. The SQL option seems is not available to a query result set, very sadly.


1

This is a question more for stackoverflow than for here, but it is great that you asked here first because we would tell you that do not need to handle that on PHP code. MySQL has a syntax called INSERT ... ON DUPLICATE KEY UPDATE that does exactly what you want, in only 1 query instead of 3. There is also REPLACE, although it is slightly different (REPLACE ...


1

GOT IT! I had to explicitly set my PHP variable types to integer after normalizing them from the Http POST function... settype($foo, "integer"); ...and then use them in the MySQL query.


0

Maybe this: $sql = "INSERT INTO Taskers (Taskers.MemberID, Taskers.EventID) VALUES (".$memberid.",".$eventid.")";


1

Sounds like you just need to do an INNER JOIN. And it also sounds like you don't know what one is? Recommend you read up: http://www.mysqltutorial.org/mysql-inner-join.aspx In your case it would be a simple: SELECT EventID, CONCAT(m.Title, " ", m.LastName) AS Member FROM Events e INNER JOIN Tasks t ON e.EventID = t.EventID INNER JOIN Members m ON ...


1

From here: "varchar fields were set to utf8_bin and needed to be changed to utf8_general_ci"


2

While there are different approaches to manage your problem, the simplest way to do it is following the most conventional relational and normalised way, which is separating Campaigns, Programs and Assets as different tables. You can specify relationships between tables like "has" or "belongs to" with foreign keys that references other table rows. You can ...



Top 50 recent answers are included