Search found 94 matches

by infomamun
Fri Sep 13, 2013 1:28 am
Forum: Linux
Topic: What is I/O of linux server?
Replies: 4
Views: 23800

What is I/O of linux server?

My site hosted in a shared hosting on a linux server. From cpanel's resouce usage option, I can see that I/O limit for my site is 4096 and in peak time, my site often reaches to its I/O limit. As I don't know much about it and as I didn't find any details article about it after googling, I was unabl...
by infomamun
Wed May 01, 2013 8:27 am
Forum: Databases
Topic: how to increment login days while log in by mysql UPDATE?
Replies: 0
Views: 2672

how to increment login days while log in by mysql UPDATE?

have following structure in a mysql table: id || username || lastlogin || days 1 || user-xyz || 2013-04-29 || 0 The above 'lastlogin' column is date column and 'days' column is int(3) column. What I want to do, while a user will login, lastlogin column will be updated everytime as usual. At the same...
by infomamun
Tue Mar 26, 2013 1:13 pm
Forum: Javascript
Topic: toggle each div next to each link
Replies: 1
Views: 3342

toggle each div next to each link

Hi there, I have the following html element in my body section: [text]<a class="tog" href="#">Click Me</a> <div class="result">This is a container div</div> <br /><a class="tog" href="#">Click Me</a> <div class="result">This is a container ...
by infomamun
Tue Mar 26, 2013 8:08 am
Forum: PHP - Code
Topic: How to use query result as global?
Replies: 7
Views: 1148

Re: How to use query result as global?

It would be my pleasure if you show that code
by infomamun
Tue Mar 26, 2013 4:14 am
Forum: Databases
Topic: not getting accurate age by mysql function
Replies: 2
Views: 3307

Re: not getting accurate age by mysql function

Thanks requinix for your advice to calculate age accurately. This is the code to calculate the age in years, months and days: $today = date_create('2013-03-26'); $birthday = date_create($row['dob']); $diff = date_diff($today, $birthday); echo 'Your age is: '.date_interval_format($diff, "%y year...
by infomamun
Tue Mar 26, 2013 1:59 am
Forum: Databases
Topic: not getting accurate age by mysql function
Replies: 2
Views: 3307

not getting accurate age by mysql function

Hello there, I store Date of Birth(DoB) in a mysql database from a html post form. So if a user enter 1957-03-07 as his DoB, then it stores as 1957-03-07 00:00:00 in mysql database which field name is 'dob'. Now I want to calculate age between current date and DoB by a php script. So I execute follo...
by infomamun
Mon Mar 25, 2013 10:53 pm
Forum: PHP - Code
Topic: How to use query result as global?
Replies: 7
Views: 1148

Re: How to use query result as global?

Thanks Christopher,
For your help and sample code.
Best Regards
by infomamun
Mon Mar 25, 2013 11:30 am
Forum: PHP - Code
Topic: How to use query result as global?
Replies: 7
Views: 1148

Re: How to use query result as global?

Hi Celauran,
Thanks for your reply and sorry for my silly mistake I made. Now problem is solved. It is showing what I want but with using global.
How can I bring expected result (if mysql field value is empty then show 'No Value') without using global in this case?
Expecting your help.
Best Regards
by infomamun
Mon Mar 25, 2013 10:48 am
Forum: PHP - Code
Topic: How to use query result as global?
Replies: 7
Views: 1148

How to use query result as global?

Hi there, I have a critical condition. I want to check a mysql field value whether it is empty or not. If empty then to show 'No Value' else show the value. So I want to execute following query: <?php function checkv($field){ global $row; if ($row[$field]=""){ echo 'No value; }else{ echo $...
by infomamun
Sat Mar 23, 2013 12:19 pm
Forum: Databases
Topic: How to check existence of a mysql table?
Replies: 2
Views: 4163

Re: How to check existence of a mysql table?

Sorry requinix,
For late reply. Yes the error is coming from another chunk of code withing same script. I solved it already. Thanks for your help.
Best Regards
by infomamun
Sat Mar 16, 2013 12:44 pm
Forum: Databases
Topic: How to check existence of a mysql table?
Replies: 2
Views: 4163

How to check existence of a mysql table?

Hi there, I want to check whether a mysql table exists in a database and run some code based on returned result. I used the following php code: mysql_connect("localhost", "[Username]","[Password]") or die(mysql_error()); mysql_select_db([Database_name) or die(mysql_erro...
by infomamun
Mon Mar 04, 2013 10:50 am
Forum: Databases
Topic: How to return all rows From one table?
Replies: 1
Views: 2796

How to return all rows From one table?

Hi there, I have two tables in my database: Table1: Purchased Item ===================== Item | Qnt | Rate |Total ===================== Meat | 1 | 20 | 20 ----------------------------- Fish | 0.5 | 30 | 15 ----------------------------- Chicken|1 | 25 | 25 ----------------------------- Meat | 2 | 20 ...
by infomamun
Fri Feb 22, 2013 1:18 am
Forum: Databases
Topic: how to show each person with last login date
Replies: 4
Views: 3215

Re: how to show each person with last login date

This is not outputting the result correctly.
It is repeating and including all dates and respective price from Table2 in output.
I think, it should be done with Left or Right join, but I cannot find out how to bring the desired result.
Please look once again to reveal out a way.
Thanks in Advance.
by infomamun
Wed Feb 20, 2013 10:50 pm
Forum: Databases
Topic: how to show each person with last login date
Replies: 4
Views: 3215

Re: how to show each person with last login date

I think you want to try GROUP BY Table2 in conjunction with MAX(Datetime). Could not understand what you said (Group by table??? :roll: ) I have tried this after your post: SELECT p.Item, p.Qnt l.price FROM Table1 as p INNER JOIN Table2 as l ON p.Item=l.Item WHERE l.Datetime=(SELECT max(Datetime) F...
by infomamun
Wed Feb 20, 2013 12:05 am
Forum: Databases
Topic: how to show each person with last login date
Replies: 4
Views: 3215

how to show each person with last login date

Hi there, I have two tables in my database: Table1: Purchased Item ===================== Item | Qnt | Rate |Total ===================== Meat | 1 | 20 | 20 ----------------------------- Fish | 0.5 | 30 | 15 ----------------------------- Chicken|1 | 25 | 25 ----------------------------- Meat | 2 | 20 ...