urtrivedi 276 Nearly a Posting Virtuoso
urtrivedi 276 Nearly a Posting Virtuoso

I hope this may help you. You can do that using css

http://www.w3schools.com/css/css_mediatypes.asp

urtrivedi 276 Nearly a Posting Virtuoso

I guess, You have to do on your own. If you are not developer then you may post this question in business exchange forum. You will find so many who can do it for you.

I am not sure following will help you or not, but here are some paid and free scripts

http://www.apphp.com/

urtrivedi 276 Nearly a Posting Virtuoso

remove line 26 to 28 in your html code, your html elements and submit button must be under same form element. You have ended form early

</form>

<br>  <form action="insert.php" method = "post">

Your insert form must look like following

<form action="insert.php" method="post">
<h3 style="text-align:center;">

<label for="Firstname">First Name:</label>      <input type="text"     name="Firstname" /><br/> 
<label for="Lastname">Last Name:</label>        <input type="text" name="Lastname" /><br/> 
<label for="Age">Age:</label>                   <input type="text" name="Age" /><br/>
<br class="clear" />

<input type="submit" value = "Save">
  </form>
urtrivedi 276 Nearly a Posting Virtuoso

if you see line 22, 23, 24

all input names are in small letters
firstname
lastname
age

and in your php handler code in your first post its in title case. Line 33,34,35

Firstname
Lastmame
Age

Both case must match as php is case sensitive like C language

urtrivedi 276 Nearly a Posting Virtuoso

Post your html code also

urtrivedi 276 Nearly a Posting Virtuoso

I am changing 4 lines of your student_login_handler.php

Line 7

$query = "select student_id,last_login_date from student_information where learner_id='$learner_id' and student_password='$student_password'";

Line 16

$_SESSION['user_id'] = $date['student_id'];

Line 19

mysql_query("UPDATE student_information SET last_login_date=now() where student_id='{$_SESSION['user_id']}'",$link_id);

Line 23

header("location:  Student_Home.php?id={$_SESSION['user_id']}"); 
urtrivedi 276 Nearly a Posting Virtuoso

Reasons:

1) Your html part is not having LastName , Age elements properlly spelled
2) Your input method may be GET instead of POST

urtrivedi 276 Nearly a Posting Virtuoso
SELECT * FROM `users` WHERE 
(
uid  not in (select friend_two from friends where friend_one='$uid' ) 
and
uid not in (select friend_one from friends where friend_two='$uid' ) 
)
urtrivedi 276 Nearly a Posting Virtuoso

post your structure and sample data here

urtrivedi 276 Nearly a Posting Virtuoso

I guess problem is in your join

LEFT JOIN friends F ON U.uid=F.friend_one

You already joing uid with freind one , with that query you willl never receive result.

can you post both sample table script and sample data here or at http://sqlfiddle.com/

urtrivedi 276 Nearly a Posting Virtuoso

I guess sublime text is just an editor with good features for progammers. But any simple notepad is enough to write php code.

create text file name it as HelloWorld.php (or any name with extension as php)
open it and write following code

    <?php
    echo "this is php code";
    echo "Hello world";

    ?>
<h1> This is html code </h1>

<h2 > this is <?php echo "php embeded in html"; ?> </h2>

Save that file in your web root directory and open it with appropriate location in any browser.

url : http://localhost/anyfolder/anysubfolder/HelloWorld.php

urtrivedi 276 Nearly a Posting Virtuoso

Try to Use distinct keyword in your query

$dropdownquery="select distinct col1,col2 ....";
urtrivedi 276 Nearly a Posting Virtuoso
$query = "SELECT *  FROM po
         wHERE (date = str_to_date({$searchString},'%m-%d-%Y') || date like str_to_date ({$searchstring},'%m-%d-%Y)) ";
urtrivedi 276 Nearly a Posting Virtuoso

We use explode fuction with seperator / , so it will give you array of size 3, then you can concate it as shown below

$datearr=explode("/",$myDate);
$dbdate=$datearr[2]."-".$datearr[0]."-".$datearr[1];
urtrivedi 276 Nearly a Posting Virtuoso

I have changed your first query
1) added 2 columns in group by
2) added where clause according to your second query

$sql = "select id,date,category,sum(q1) Total,sum(q2) Total2,sum(q3) Total3,sum(q4) Total4,sum(q5) Total5,sum(q6) Total6 from articles WHERE from_date >= '".mysql_real_escape_string($_REQUEST["from"])."' AND to_date <= '".mysql_real_escape_string($_REQUEST["to"])."'".$search_string.$search_city."  group by category order by id, date,category ";
urtrivedi 276 Nearly a Posting Virtuoso

try following as i suggested before

where f.friend_two <> '$uid' and F.friend_one <> '$uid'
urtrivedi 276 Nearly a Posting Virtuoso

To get correct result
1) I think you need to join clause to join users U, friends F
2) need to put where f.friend_two <> '$uid' and F.friend_one <> '$uid'

urtrivedi 276 Nearly a Posting Virtuoso

Your requirement is just grouping, its does not look like tree

You can do this using two queries

$cityquery= "select distinct city from usertable"
loop -- through above records and in loop fetch users for the city
echo $cityrow['city']
$userquery "select usernaem from usertable where city='{$cityrow['city']}'";

loop
   echo "&nbsp;&nbsp;&nbsp;".$userrow['userid'];
end loop

end loop ---city

urtrivedi 276 Nearly a Posting Virtuoso

Simply the page that you want to show to public users, do not keep session check in such pages.

urtrivedi 276 Nearly a Posting Virtuoso

I have put coluname in query as told by djbirdi and I have put alias a after parenthesis. Try with alias

$query=mysql_query("SELECT COUNT(*) AS total FROM (SELECT uid_fk FROM message_believe WHERE message_believe.uid_fk ='$uid' UNION ALL SELECT uid_fk FROM review_believes WHERE review_believes.uid_fk ='$uid' ) a");
urtrivedi 276 Nearly a Posting Virtuoso

I have put alias a after parenthesis. Try with alias

$query=mysql_query("SELECT COUNT(*) AS total FROM (SELECT COUNT(*) FROM message_believe WHERE message_believe.uid_fk ='$uid' UNION ALL SELECT COUNT(*) FROM review_believes WHERE review_believes.uid_fk ='$uid' ) a");
urtrivedi 276 Nearly a Posting Virtuoso

so where you put the code you shown in your fist post?

urtrivedi 276 Nearly a Posting Virtuoso

set javascript global variable onload
that warn=1;

but in onsubmit set warn= 0;

Then on unload, you can see variable value and put alert

<script>
window.onbeforeunload= function() { 
if (warn==1 ) return "Save your data plz"; };
</script>
urtrivedi 276 Nearly a Posting Virtuoso

Where is your code, and what error you get while running your script?

urtrivedi 276 Nearly a Posting Virtuoso

what u have did till now?

urtrivedi 276 Nearly a Posting Virtuoso

you must have column in table foto that its vidoe or image. Use if condtion based on that column value to chose your html code

urtrivedi 276 Nearly a Posting Virtuoso

Hericles, Now I guess users thinks that moderators are OMNISCIENT

urtrivedi 276 Nearly a Posting Virtuoso

Put that in begining of your code

set_time_limit(2000);
urtrivedi 276 Nearly a Posting Virtuoso

I agree with hericles.

But as temporary solution following should work

SELECT
    a.price,
    b.price
    FROM table1 AS a
    INNER JOIN table2 AS b ON a.sku = b.sku
    ORDER BY case when a.price>=b.price then a.price else b.price end desc
urtrivedi 276 Nearly a Posting Virtuoso

Now you have query, you can tweak around it. Though run following one also, I have changed b.type<>d.type to b.type=d.type. My query assumes that your date column is also having time part as you mentioned in your above post.

If your date column is not having time part, then query may not work properly

select a.maxtime maxtime_firstday,b.type type_firstday,
c.mintime mintime_secondday, d.type  type_secondday 
from (
    select 
    DATEADD(dd, DATEDIFF(dd, 0, tlogs.Date), 1) nextday,
      max(tlogs.Date) maxtime from tlogs group by DATEADD(dd, DATEDIFF(dd, 0, tlogs.Date), 0),
    DATEADD(dd, DATEDIFF(dd, 0, tlogs.Date), 1)

    ) a
left outer join tlogs b on a.maxtime=b.date
left outer join (
    select DATEADD(dd, DATEDIFF(dd, 0, tlogs.Date), 0) currday,
      min(tlogs.Date)mintime from tlogs group by  DATEADD(dd, DATEDIFF(dd, 0, tlogs.Date), 0) 
) c on a.nextday=c.currday
left outer join tlogs d on c.mintime=d.date
where b.type=d.type and a.maxtime between '2014-01-01' and '2014-01-31'
urtrivedi 276 Nearly a Posting Virtuoso
urtrivedi 276 Nearly a Posting Virtuoso

if you run all part by part you can understand

set 1

SELECT cashid, sum(amt) AS ramt, NULL AS pamt
      FROM receipt WHERE cashid IN ('17','23') GROUP BY cashid

set 2

SELECT cashid, sum(amt) AS ramt, NULL AS pamt
      FROM receipt WHERE cashid IN ('17','23') GROUP BY cashid

set 2 = set 1 union set 2

SELECT cashid, sum(amt) AS ramt, NULL AS pamt
      FROM receipt WHERE cashid IN ('17','23') GROUP BY cashid
  UNION ALL
    SELECT cashid, NULL AS ramt, sum(amt) AS pamt
      FROM payment WHERE cashid IN ('17','23') GROUP BY cashid)

now set 3 is base table for us and simple sum and subtraction performed on set 3

urtrivedi 276 Nearly a Posting Virtuoso
echo array_sum($points)/count($points);
tapananand commented: I didn't know there is a function to calculate sum of array as well. PHP just doesn't want us to do anything. +2
urtrivedi 276 Nearly a Posting Virtuoso
SELECT cashid, sum(ramt) ramt, sum(pamt)pamt, ifnull(sum(ramt), 0)-ifnull(sum(pamt), 0) balance
  FROM (
    SELECT cashid, sum(amt) AS ramt, NULL AS pamt
      FROM receipt WHERE cashid IN ('17','23') GROUP BY cashid
  UNION ALL
    SELECT cashid, NULL AS ramt, sum(amt) AS pamt
      FROM payment WHERE cashid IN ('17','23') GROUP BY cashid)
AS bal

GROUP BY cashid
urtrivedi 276 Nearly a Posting Virtuoso

I am looking into it

urtrivedi 276 Nearly a Posting Virtuoso

Are you able to run my query or not.
Have you seen the result?

urtrivedi 276 Nearly a Posting Virtuoso
select a.maxtime maxtime_firstday,b.type type_firstday,
c.mintime mintime_secondday, d.type  type_secondday 
from (
    select 
    DATEADD(dd, DATEDIFF(dd, 0, tlogs.Date), 1) nextday,
      max(tlogs.Date) maxtime from tlogs group by DATEADD(dd, DATEDIFF(dd, 0, tlogs.Date), 0),
    DATEADD(dd, DATEDIFF(dd, 0, tlogs.Date), 1)

    ) a
left outer join tlogs b on a.maxtime=b.date
left outer join (
    select DATEADD(dd, DATEDIFF(dd, 0, tlogs.Date), 0) currday,
      min(tlogs.Date)mintime from tlogs group by  DATEADD(dd, DATEDIFF(dd, 0, tlogs.Date), 0) 
) c on a.nextday=c.currday
left outer join tlogs d on c.mintime=d.date
where b.type<>d.type and a.maxtime between '2014-01-01' and '2014-01-31'
urtrivedi 276 Nearly a Posting Virtuoso
function insert_csv($data)
{
    $query = $this->db->query("select count(*) cnt from category where cat_id='{$data['cat_id']}'");
    $row = $query->first_row();

    if(trim($data['cat_id'])!="" && $row->cnt==0)
        $this->db->insert('category', $data);
}
function insertcsv($data)
{

    $query = $this->db->query("select count(*) cnt from sub_category where sub_cat_id='{$data['sub_cat_id']}'");
    $row = $query->first_row();

    if(trim($data['sub_cat_id'])!="" && $row->cnt==0)   
        $this->db->insert('sub_category',$data);
}
urtrivedi 276 Nearly a Posting Virtuoso

I am asking for mysql script and sample csv file you upload

urtrivedi 276 Nearly a Posting Virtuoso
select cashid, ramt, pamt, ifnull(ramt,0)-ifnull(pamt,0) balance from (
select cashid, sum(amt) as ramt, NULL AS pamt from receipt where cashid in ('17', '23') GROUP BY cashid
    union all
select cashid, NULL AS ramt, sum(amt) as pamt from payment where cashid in ('17', '23') GROUP BY cashid
)
group by cashid
urtrivedi 276 Nearly a Posting Virtuoso

attach here your php file ,sample csv file and mysql table script, so that your code can be tested here

urtrivedi 276 Nearly a Posting Virtuoso

at line 145 after while loop you can check $row variable

If ($row==0 )
   echo "UPLOAD FILE WITH PROPER RECORDS";
urtrivedi 276 Nearly a Posting Virtuoso

This is going to be complicated for you.

Whenever you store time, You should store it as date time.

That will help to analyse things in better manner.
You should have keep only single datetime column instead of 2 separate columns

Right now if you run max min fuction on your time column (as now its text field I guess), your query will return 08:00 as max value

urtrivedi 276 Nearly a Posting Virtuoso

You may use on duplicate phrase, if your table has proper primary key or unique key combination. It wil not give any error on duplicate value insertion, rather it wil update it accoding to what you set to update

$sql = "insert into table (col1,col2) values (val1,val2)  on duplicate key update  col1=val1";
urtrivedi 276 Nearly a Posting Virtuoso

What diafol suggested looks like the best possible solution.

urtrivedi 276 Nearly a Posting Virtuoso

I agree with pritaeas

if (!isset($_GET[screen]))
  $screen = 0; 
else 
  $screen=$_GET[screen];
urtrivedi 276 Nearly a Posting Virtuoso

ever changing means what,

how frequently columns sequence changed?
hourly, daily, weekly , monthly ???

urtrivedi 276 Nearly a Posting Virtuoso

I think you do not need where condition, following should work

$sql="select playername from tablejollys  order by rand()  limit 1";
urtrivedi 276 Nearly a Posting Virtuoso