/    Sign up×
Community /Pin to ProfileBookmark

Hi..

I have created a small website with php and mysql.
I have passed the parameters via url and based on that generating the webpage.
in MySql query I am using the Limit and Offset command to create the pages.
But while handling the pageno the offset is not coming proper value.

Kindly help to me to close the issue. Now I have posted in oracle basic questions only for testing.
For ref my site address is [URL=”http://faq.atchaya.in”]http://faq.atchaya.in[/URL]

Thanks in advance

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@ginerjmFeb 22.2016 — If you have some PHP code to show us, please post it here.
Copy linkTweet thisAlerts:
@ksakthivelpptauthorFeb 23.2016 — Following is the PHP Code..

function buildq($tblname, $module, $page, $qperpage)

{

include 'dbconfig.php';

$offset = $page -1 ;

$offset = $offset * $qperpage;

$user_id = $_SESSION['user_session'];

if ($parent=="") $parent="";

$stmt = $DB_con->prepare("SELECT *
FROM " . $tblname . " WHERE del_flag='N' and module_id= '" . $module . "' LIMIT " . $quesperpage . " OFFSET " . $offset);

$stmt->execute(array(":user_id"=>$user_id));

$userRow=$stmt->fetchAll(PDO::FETCH_ASSOC);

$ncount =0;

foreach($userRow as $row)

{

.

.

.

.

}

}

Thanks in advance

Sakthivel. K
×

Success!

Help @ksakthivelppt spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...