doh I guess there is no point in doing that, you can get combined value any time with select.
__________________
Found a flower or bug and don't know what it is ? agrozoo.net galery
if you don't spot search button at once, there is search form: agrozoo.net galery search
$helloo2=mysql_query("CREATE VIEW question_id_num AS SELECT id,name FROM taskitems ORDER BY id DESC limit 0,5") or die($mysql_error()); $helloo3=mysql_query("Update taskitems Set name = question_id_num.id.name") or die($mysql_error());
But I'm getting this error: Fatal error: Function name must be a string in /home/tom/public_html/controlpaneladdassignment.php on line 26
Line 26 is the first of the two lines. Any suggestions?
Yes, an important suggestion: Learn what a VIEW is.
A VIEW is just a pre-defined SELECT on an existing table.
It is *NOT* a table. It can *NOT* be used as a table for any purpose other than as a replacement for SELECT.
Code:
CREATE VIEW question_id_num
AS
SELECT CONCAT( CAST(id AS CHAR) ,name ) AS idName, list, of, other, fields, as, you, want
FROM taskitems;
Nothing more.
You would still *ONLY* use the taskitems table when inserting or updating data.
You would *ONLY* use the view when making reports, etc.
Hi O.P, thanks for your reply.
So I've been trying to understand views and slowly progressing.
I tried your code and it works great. However, how do I go about concatenating with a dot in between the two? I tried this, but I get ".idname" outputted:
Code:
CREATE VIEW question_id_num AS SELECT CONCAT_WS(CAST(id AS CHAR),'.',name) AS idname FROM taskitems;