-3

I want to combine

SELECT * FROM form

with

SELECT REPLACE(/var/WWW/html, "/var", "/vur")

After that I want to put it in a php variable.

I tried this:

$SQL = "SELECT * FROM form" with "SELECT REPLACE (/var/WWW/html, "/var", "/vur")"

I want SELECT everything of my database but I also want to replace text from one column.

It should be like this:

  1. select everything of the database
  2. replace text of column no. 12
  3. put it in a variable

Is this possible? And how?

DejanLekic
  • 17,326
  • 3
  • 42
  • 73
qpA
  • 75
  • 1
  • 8

2 Answers2

3

If I have understand your issue, this query should solve it

SELECT *, REPLACE(myColumn, "/var", "/vur") something FROM form
Sergio Rinaudo
  • 1,840
  • 12
  • 18
  • I will check it in a minute but I think its the right way :) – qpA Jun 05 '19 at 11:01
  • 1
    Don't worry :) I also advise you not to use the SELECT *, check this out https://stackoverflow.com/questions/321299/what-is-the-reason-not-to-use-select – Sergio Rinaudo Jun 05 '19 at 11:04
-2

Maybe you searched for the SQL UNION command.

root_id
  • 9
  • 7