Jump to content

add Prefix to MySql


cpugeek

Recommended Posts

I was wondering what the code for putting a predefined prefix in front of the table and column for both when retrieving and sending to MySql databaseexample (best to my knowledge)

$TPrefix = "TablePrefix_";$CPrefix = "ColumnPrefix_";$examplevariable = mysql_query("SELECT $CPrefix + fakecolumnname FROM $TPrefix + faketablename;")

Keep in mind i'm not the best with MySqlAny and All help is appreciated. :)

Link to comment
Share on other sites

Why don't you just append it is PHP?

$examplevariable = mysql_query("SELECT {$CPrefix}fakecolumnname FROM {$TPrefix}faketablename;");

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...