At the beginning your script, so that Query with Select can recognize the variable.
Thanku for your help and suggestions m gonna try and then let u know about this
And what about
its not working when i used SET @row_number = 0;
and error is acurring due to ’ @ ’
i think its because it is used to assign variable in sql but not in PHP as the script is in PHP so its causing error
SELECT
@c:= @c+ 1 AS linesnumber, t.yourfield1, t.yourfield2
FROM
(SELECT @c := 0) AS something,
yourtable t
It’s work
https://rextester.com/l/mysql_online_compiler
it is working when used as such but not with remove headings of columns
Hey friend, explain it right. You started the topic by saying that there was an error in executing the Select command. Am I right ? You didn’t talk about removing the column names.
The error problem was solved, correct?
Removing the column names is another topic and this you will do in the Kodular blocks.
No i think u mis understand
Please have a look
I appreciate your suggestions and help its means a lot for me but i asked a little bit different thing
Here check it
My problem was to solve these two
One is solved by your suggested query
@Rogerio_Rios And one thing by your query the first problem is solved and the second one is still persistent
Again thanks
Edit
Please have a look if somehow it could be solved!!! Then we will b all done
concatenated queries like this are not possible without modifying the provided php script
Taifun
This post was flagged by the community and is temporarily hidden.
What is the second mistake? In his post, you presented 2 errors inside Companion, because the Set command was not giving the script a correct result. The second query you inserted a comment - without collumn headings and in my view this will always give error. Well, I couldn’t find where you ask not to have the column names.
this select solved the concatenation problem
you could add an autoincrement column in the table (column name could be for example id) and use a simple Select statement like this
SELECT id, Post FROM Posts LIMIT 5
Taifun
No it works fine with php my admin and give the results perfectly
Then why its not working through app
Sory it was my mistake i forget to add these lines
Buy i added that this is the problem i m faccing with this query and during writing forget to add a little more details
Sory for that i m gonna edit it and will add these to
Yup i can do this but in my case i m sorting data with a coloum time stamp named “latest activity”
And after ordering by this column i cannot load items 5 by 5 or 10 by 10 because i did not know the range (here i m loading data as between 5 and 10 etc ) as id column is now arranged randomly due to odering by latest ‘activity column’
That’s way i need to run this complex query
But if u have another solution then suggest me
Yes it is satisfied solution to problem no 1
But now please once try to resolve the 2nd problem too
I will be very grateful to you
1-
Select field1 as ‘’ , field2 as ‘’ from table
2-
Select (@row_number:=@row_number + 1) AS ‘’, Post as ‘’ FROM Posts LIMIT 3;
This should work 100% in php script
3-Double quotes worked fine
Ultimate Version !
Select @c:= @c+1 as “”, t.CNOMEALU as “” From (Select @c := 0) as x, alunos t
Finally problem gets solved
Thank u @Rogerio_Rios for you time and suggestions
>3000
I was unable to solve this problem if u didn’t help
I have no words to express my feelings right now
Stay blessed
And m also thankful to others too who also help me through their suggestions
Love this comunity
Here are regards to all of these
@Rogerio_Rios
@vknow360
@ShaikhSajidAli
@Taifun
Thank u gyz especially @Rogerio_Rios
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.