| | |
Pagination Without Limit in Query
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
0
#21 30 Days Ago
That is a basic mysql error which means mysql has been told to search for a column named id_tariffplan however no such column exists. A common problem for this is mis-spelling the column and not having the column inserted in the first place.
Try not to bump 10 year old threads as it can be really annoying.
http://syntax.cwarn23.net/
My favourite PC. - Oopy Doopy Do 2U2!
http://syntax.cwarn23.net/
Smilies: ^_* +_+ v_v -_- *~*` My favourite PC. - Oopy Doopy Do 2U2!
•
•
Join Date: Sep 2009
Posts: 557
Reputation:
Solved Threads: 64
0
#22 30 Days Ago
"The discipline of writing something down is the first step towards making it happen."
follow me on twitter
follow me on twitter
•
•
Join Date: Sep 2009
Posts: 557
Reputation:
Solved Threads: 64
-1
#23 30 Days Ago
id_tariffplan is the variable to hold the first parameter value passed to the stored procedure.
So its not a column name.Either the error is "unknown column idtariffplan" , (where idtariffplan is the column name) and id_tariffplan will just assign its value to it in the where clause.
So its not a column name.Either the error is "unknown column idtariffplan" , (where idtariffplan is the column name) and id_tariffplan will just assign its value to it in the where clause.
"The discipline of writing something down is the first step towards making it happen."
follow me on twitter
follow me on twitter
•
•
Join Date: Jun 2009
Posts: 121
Reputation:
Solved Threads: 2
-1
#24 29 Days Ago
mysql Syntax (Toggle Plain Text)
DROP PROCEDURE IF EXISTS `dd`.`view_ratecard`$$ CREATE DEFINER=`root`@`localhost` PROCEDURE `view_ratecard`(id_tariffplan INT(11),page_size INT(2),row_start INT(2),country_code CHAR(30)) BEGIN SET @lim = CONCAT(' LIMIT ', row_start, ',', page_size); if(country_code="") THEN SET @q = "select dialprefix,destination,rateinitial,initblock,billingblock,id_trunk,grace,idtariffplan,id from cc_ratecard where idtariffplan=id_tariffplan and rate_version='0' ORDER by destination asc"; ELSE SET @q = "select dialprefix,destination,rateinitial,initblock,billingblock,id_trunk,grace,idtariffplan,id from cc_ratecard where idtariffplan=id_tariffplan and rate_version='0' and dialprefix like concat(country_code,'%') ORDER by destination asc"; END if ; SET @q = CONCAT(@q, @lim); PREPARE st FROM @q; EXECUTE st; DEALLOCATE PREPARE st; END$$ DELIMITER ; END if ;
This is your Store procedure..
i m just calling in database by call function
call view_ratecard_php('1','10','0','')
and it throughing the error
Last edited by sam023; 29 Days Ago at 4:55 am.
•
•
Join Date: Jun 2009
Posts: 121
Reputation:
Solved Threads: 2
0
#25 29 Days Ago
•
•
•
•
id_tariffplan is the variable to hold the first parameter value passed to the stored procedure.
So its not a column name.Either the error is "unknown column idtariffplan" , (where idtariffplan is the column name) and id_tariffplan will just assign its value to it in the where clause.
id_tariffplan is variable and idtraiffplan is column name..!!! but still i m getting this error
PHP Syntax (Toggle Plain Text)
Unknown column 'id_tariffplan' in 'where clause'
i think it is because here you are writing query in string format..!! by string format i mean query in double quotes""... then how can u pass variable in it..?
i think for passing variable in string we need '?'
i have already a SP for limit..! but i just to try your SP..!!
•
•
Join Date: Sep 2009
Posts: 557
Reputation:
Solved Threads: 64
0
#26 16 Days Ago
No.MySQL throws this error , when we try to specify a column name not present in the table structure.
So make sure the table structure is fine
So make sure the table structure is fine
"The discipline of writing something down is the first step towards making it happen."
follow me on twitter
follow me on twitter
•
•
Join Date: Jun 2009
Posts: 121
Reputation:
Solved Threads: 2
0
#27 15 Days Ago
•
•
•
•
No.MySQL throws this error , when we try to specify a column name not present in the table structure.
So make sure the table structure is fine
mysql Syntax (Toggle Plain Text)
SELECT dialprefix,destination,rateinitial,initblock,billingblock,id_trunk,grace,idtariffplan,id FROM cc_ratecard WHERE idtariffplan=id_tariffplan
Thats what i m saying.. Mysql taking id_tariffplan as column not as variable.. and there is no column name as id_tariffplan...thats why it is throwing that error..!! may be because it in string format..!!!
even if u run above query out of SP(directly).. it will throw same error..!!!
![]() |
Similar Threads
- How to use large pagination in a limited area (PHP)
- Clean Previous Next Script for MySQL results (PHP)
- pagination not displaying results (PHP)
- About LIMIT in mysql (PHP)
- search results question (PHP)
- pagination problem (PHP)
- pagination of mysql query results (PHP)
- PHP Search pagination problem (PHP)
Other Threads in the PHP Forum
- Previous Thread: send html form as mail attachment in php
- Next Thread: stop playing 4 10 sec while buffer mp3 file?
Views: 954 | Replies: 27
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl database date directory display download dynamic echo email error execution file files folder form forms function functions google href htaccess html htmlspecialchars image include insert integration ip java javascript joomla jquery limit link links login loop mail menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote replace script search select server session sessions sms soap source space speed sql structure syntax system table tutorial update updates upload url validation validator variable video web xml youtube






