6:52 AM
hi
 
Hi
get the Total_count from the mysqli query
have you got it?
 
thanks for coming here
no, actually i tried your code
its displaying results as before
 
what you get?
 
but its not displaying how many rows [ count] displaying
let me show you the screen
can you visit link
 
pls avoid the $row_cnt = mysqli_num_rows($result); from your code
 
6:56 AM
email : [email protected] , pw : kidsdial1
 
ok
yeah i got it
 
i hide this code : $row_cnt = mysqli_num_rows($result);
are you seeing this link
when you select from & to date and click on search button, it will display results
but i need to display how many rows displayed
i am not linking "search" button with "code to display number of rows" , is that what i need to do or can i get output with help of javascript ?
 
if start_date is 2016-12-01 and end date is 2016-12-03 you need to get the count 1 am i right?
 
yes thats right
 
where you want to display the count??
 
7:01 AM
wherever in page , okaynext toafter "search " button
 
ok...
you fetching the records from the data base by selecting the date, what the mysqli query you used here?
 
this is complete code : pastebin.com/gMDGF4dx
 
ok let me know after i review your complete code.. ok?
 
please check, thanks a lot......
 
ok dude
stay here
 
7:08 AM
ya sure, i will.....
 
could you please point out the exact query in your code which you fetching the records from the database after submit the form by selecting the date
 
just a min
 
we are using this magento code to fetch results to all "dates" present in database
$order = Mage::getModel('sales/order')->getCollection()->addAttributeToFilter('designer_id', array(
'nin' => '0'
));
 
7:18 AM
in the full code, i we combined both magento + php code to display all rows, but i need to get "number of rows count" by php code..... sorry i am new to this coding world.....
 
ok no problem
echo the $order in your code and paste the output here
 
okay
i am gettting "Notice: Undefined variable: order " when i tried "echo $order;" at end of the file
 
no echo the order after the end of following code line
$order = Mage::getModel('sales/order')->getCollection()->addAttributeToFilter('designer_id', array(
'nin' => '0'
));
 
sorry , i treid as you said , but it didt displayed any results......
 
ok
i got
order is an array so
after this line
foreach($order as $orderData)
sorry sorry
before this line
 
7:26 AM
okay
 
foreach($order as $orderData)
print_r($order);exit;
 
i tried, now table disappeared
 
delete the exit;
 
okay
deledted exit, still table not displaying
 
try this
var_dum($order);
sory var_dump($order);
 
7:31 AM
same result when i used var_dump($order); - table disappeared
if you see [link](http://sbdev2.kidsdial.com:81/php/site6/orders1.php) you can see multiple columns in table.

until column " DEsigner" its fetching values from "magento db" & and other columns resuts fetching from "php db"
 
if i try this code , i can able to display all values from "order_details" table : w3schools.com/php/showphpfile.asp?filename=demo_db_select_oo
 
do you have the query that you fetching the records from php db
 
yes, just a min
$stmt = $user_home->runQuery("SELECT * FROM order_details");
$stmt->execute(array(":uid" => $_SESSION['userSession']));
$row = $stmt->fetch(PDO::FETCH_ASSOC);
$stmt->execute();
 
yeah correct
now replace the following query
SELECT *,count( * ) as Total_count FROM order_details
 
7:37 AM
is this correct ?
$stmt = SELECT count( * ) as Total_count ,* FROM order_details;
$stmt = SELECT *,count( * ) as Total_count FROM order_details;
Parse error: syntax error, unexpected ','
 
$stmt = $user_home->runQuery("SELECT *, count( * ) as Total_count FROM order_details");
 
updated your code and hided below lines
//print_r($order);
//var_dum($order);
table displaying
 
yeah
have you got the result
 
no of rows : not displaying
 
go to localhost/phpmyadmin
and select your db
 
7:40 AM
okay i will send scrrenshot
 
ok
execute this query in phpmyadmin
SELECT *, count( * ) as Total_count FROM order_details
 
i got above result
 
wait a min
ok dude i got it
 
okay
 
group by dorder_id at the end of the query
SELECT *, count( * ) as Total_count FROM order_details group by dorder_id
 
7:47 AM
i want to inform from and to date results are coming with respect to "ORderDate" column, "order date " column is in magento db , not in php db .....
 
ok
can you increment the value?
 
soory, i didt got......
is i need to try this : UPDATE order_details SET ID = ID + 1; ?
lunch break now, please be here.... i will come at 2.30......
 
8:06 AM
ok
 
8:39 AM
i Have work so shall we chat in tonight ? after 10.pm?
 
8:56 AM
Hi dude
i have one solution on same mysql query
select *,(SELECT count( dorder_id ) FROM order details) as Total_count from order details
it should count exactly what you want
so you can use Total_count in your code
yeah finally we got it
from this query you get the same count in each and every row while execute this query in phpmyadmin
congrats dude
 
hi, sory for delay, i went for lunch , i will try......
 
its ok
now my lunch time starts
 
okay, you can carry on......
 
but now i'm waiting for the result
just excute and share the screenshot here
right now..
 
syntax error
i am tryingto resolve
 
9:04 AM
what the error
 
select *,(SELECT count( dorder_id ) FROM order details) as Total_count from order details;
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order details) as Total_count from order details' at line 1
 
SELECT *, (SELECT count( dorder_id ) FROM order details) as Tot FROM order details
 
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order details) as Tot from order details' at line 1
 
wait a min
 
i replaced "Total" by "Tot",
okay
 
9:08 AM
select *,(SELECT count( * ) FROM orderdetails) as Tot from orderdetails
hey man
check the table name
order_details
 
okay , sorry
 
select *,(SELECT count( * ) FROM order_details) as Tot from order_details
 
got above result
 
no i want to display in site - count
 
9:10 AM
ok
 
please help me for that
 
you can get the value of this
how you get and display the records from this table?
same as you can do
 
but number of count is more right ? because all rows are fetching from magento db.....
now we are trying query in php db
 
get the value of Tot column after the query execution
 
can you please tell what code i need to modify ?
 
9:14 AM
what are the values you passing in the arrays
 
$orderData->getIncrementId() ,
$orderData->getIncrementId() ,
$orderitemsarray[$k],
$productdetail->getName() ,
$designerName,
$orderData['status'], // magento [ pending / processing/complete]
$orderData['grand_total'], // magento
$orderData['customer_email'], // magento
$commission,
$paid_status,
$delivery_status,
$due_date,
$sDate // mage
 
ok let us continue at 5p.m
 
okay sure, thanks .......
 
its ok
you from?
 
bangalore......
 
9:16 AM
home town?
 
shimogha....
what about you ?
 
your sweet name?
 
vickey.....
 
nice
same name
 
thanks your name also cute......
 
9:18 AM
ok dude catch you later
 
middle name is my fav god.....
 
asure, thanks again......