urtrivedi 276 Nearly a Posting Virtuoso

uncomment //print $sql; in line 305
copy that prepared query from browser and run in phpmyadmin, see the result or sql error there

urtrivedi 276 Nearly a Posting Virtuoso

what is the problem u face
error, no result, invalid result or any other
tell specific problem

urtrivedi 276 Nearly a Posting Virtuoso

You need to learn tutorials and need to understand concept of dynamic pages. some body here can help u find bugs/errors in your code, but its not possible for anyone to help u teach whole system here in this forum.

you can start with

http://www.w3schools.com/php/php_mysql_intro.asp

urtrivedi 276 Nearly a Posting Virtuoso

I put group by in query and put conidtion outside of while to show "no-record"

<?php

include 'db.php';
$term = $_POST['EAN'];
$term = TRIM($term);

$sql = mysql_query("SELECT Name, Brand, EAN, sum(orderedquantity) As SumS 
FROM $salesdb 
WHERE EAN LIKE '%$term%' group by  Name, Brand, EAN Limit 0,5");
$i=-1;
while ($row = mysql_fetch_array($sql))
{
    $i++;


    Print '<table style="width:100%;margin-left:auto;margin-right:auto" border=1><font face=arial size=2 >
<tr><td>Sales 2012:<b>'.$row['SumS'].'</b></td></tr></table>';
}


if($i==-1)
{
    Print '<table style="width:100%;margin-left:auto;margin-right:auto" border=1><font face=arial size=2 > <tr><td>Sales 2012:<b>"None Sold"</b></td></tr></table>';

}


?>
urtrivedi 276 Nearly a Posting Virtuoso

line 11 must have double equal to, comparison, u put only 1

if($row['field4'] ='')

make it

if($row['field4'] =='')

urtrivedi 276 Nearly a Posting Virtuoso

post complete code

urtrivedi 276 Nearly a Posting Virtuoso

ON keyword is missing in your code

select persons.firstname,orders.cost from 
persons inner join orders on  persons.p_id=orders.p_id 
where (cost between 0 and 150)
urtrivedi 276 Nearly a Posting Virtuoso

I guess if you have logout.asp, you can write this code in it

<% Response.Redirect(Request.ServerVariables("HTTP_REFERER")) %>

urtrivedi 276 Nearly a Posting Virtuoso

http://phpsense.com/2007/php-pagination-script/

try this class, its simplest pagination class i have seen so far.

urtrivedi 276 Nearly a Posting Virtuoso

try to do that in asp code
may be in logout.asp (if it exists) or where where u destryoing session, there u put following line

<% Response.Redirect("front.htm") %>

urtrivedi 276 Nearly a Posting Virtuoso
VALUES ((1, 'Port

there is extra ( after values remove one from it

urtrivedi 276 Nearly a Posting Virtuoso
<?php



  $comma="";
  while ($row = mysql_fetch_array($result)){
    echo $comma.'["' .$row[1]. '",' .$row[2].']';
    $comma=", ";

  } // end while


?>
urtrivedi 276 Nearly a Posting Virtuoso

I am reposting it, have u seen my previous reply

function  checkEmail($email) 
    {
         if (!preg_match("/^([a-zA-Z0-9\._-])+([a-zA-Z0-9\._-] )*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/" , $email)) 
         {

              return false;
         }
         return true;
    }
urtrivedi 276 Nearly a Posting Virtuoso
urtrivedi 276 Nearly a Posting Virtuoso

one field status with enum (active , inactive)

urtrivedi 276 Nearly a Posting Virtuoso
var beaches = [
  ['Miskolci road / Shell Station', <?php echo $row[2]; ?> , 4],
urtrivedi 276 Nearly a Posting Virtuoso

this is simple php email checker, use this to get your task completed

function  checkEmail($email) 
    {
         if (!preg_match("/^([a-zA-Z0-9\._-])+([a-zA-Z0-9\._-] )*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/" , $email)) 
         {

              return false;
         }
         return true;
    }
urtrivedi 276 Nearly a Posting Virtuoso

you can keep status flag in table in mysql with each image.

say active inactive

and when u display gallery in php, just put where status='active'
so it will display only active images.

so i suggest not to delete images physically

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

u can close this thread now by setting solved

urtrivedi 276 Nearly a Posting Virtuoso

try this also

select  tbluser.username, tblrewards.title 
FROM tblwinners inner join tbluser on tbluser.customer_id = tblwinners.customer_id
inner join tblrewards on tblwinners.reward_id=tblrewards.reward_id
urtrivedi 276 Nearly a Posting Virtuoso

my second query failed becaseu your completereward and rblwinners having both rewardid and cust_id, the momement i join both on customer id (only diff between qery1 and query 2), query return null

This is not good way but i add distinct to first query try this

select distinct tbluser.username, tblrewards.title 
FROM tblwinners inner join tbluser on tbluser.customer_id = tblwinners.customer_id
inner join tblcompleterewards ON tblwinners.reward_id = tblcompleterewards.reward_id 
inner join tblrewards on tblcompleterewards.reward_id=tblrewards.reward_id
urtrivedi 276 Nearly a Posting Virtuoso

what is relation between reward and complete reward, how and when rows stored in them

urtrivedi 276 Nearly a Posting Virtuoso

just add distinct to my first query after select word

urtrivedi 276 Nearly a Posting Virtuoso

what error it gives?
is it syntax error in query or result not proper?

urtrivedi 276 Nearly a Posting Virtuoso

I hope this works

select tbluser.username, tblrewards.title 
FROM tblwinners inner join tbluser on tbluser.customer_id = tblwinners.customer_id

inner join tblcompleterewards ON tblwinners.reward_id = tblcompleterewards.reward_id 
and tblwinners.customer_id = tblcompleterewards.customer_id 

inner join tblrewards on tblcompleterewards.reward_id=tblrewards.reward_id
urtrivedi 276 Nearly a Posting Virtuoso

This query will list completed awards winner,

select tbluser.username, tblrewards.title 
FROM tblwinners inner join tbluser on tbluser.customer_id = tblwinners.customer_id
inner join tblcompleterewards ON tblwinners.reward_id = tblcompleterewards.reward_id 
inner join tblrewards on tblcompleterewards.reward_id=tblrewards.reward_id
urtrivedi 276 Nearly a Posting Virtuoso

post latest one

urtrivedi 276 Nearly a Posting Virtuoso

I was expecting the query u have written so far. Your efforts

urtrivedi 276 Nearly a Posting Virtuoso

post your query u have written so far

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

you can write whatever way u comfortable, sql have allow both option with and without aliases,

uses of alias in my view
1) so many times query use function and expression having so many columns involved, that is to be named with some alias to refer in better way in ur programming language
2) suppose you want to refer same column twice(for whatever reason), to distinguish, u may call like

select colA as firstA, colA as SecondA

3) when query is big, and you join so many table say 10 table, so its nice for some lazy programmer (like me) to just give alias for long table name to make query quick and short

YOU ARE FREE TO NOT USE ALIAS

urtrivedi 276 Nearly a Posting Virtuoso

post few reocordds from employee and few from timetable(where some ar lare and some are not late)

do not past combine query result, just paste 2 separte table records.

urtrivedi 276 Nearly a Posting Virtuoso

i think its missing parenthesis () around value list
inset do not work with = sign, what u doing is for update query.

urtrivedi 276 Nearly a Posting Virtuoso

what error u getting?
eroor message or record not inserting?

urtrivedi 276 Nearly a Posting Virtuoso

http://phpsense.com/2007/php-pagination-script/
see this , this is nice way to do it

urtrivedi 276 Nearly a Posting Virtuoso

This query shows all record who come after their standard in time.

                       $sql = mysql_query("SELECT employees.*, timetable.*  FROM employees INNER JOIN timetable ON
                                             employees.id = timetable.id WHERE timetable.in_time > str_to_date(concat(timetable.date,' ',employees.timein)  ,'%Y-%m-%d %r')");
urtrivedi 276 Nearly a Posting Virtuoso

what is in time, is it same for all or is it diffent for all

urtrivedi 276 Nearly a Posting Virtuoso

post your table structure sql here

urtrivedi 276 Nearly a Posting Virtuoso

see line 64 to 68, i m updating it in our code

  while ( $row = mysql_fetch_array( $result ) ) 
  {
      if($row['bankID']==$_POST['bankID'])
         $selectbank=" selected ";
       else
         $selectbank="";
      ?>
      <option value="<?php echo $row['bankID']; ?>"  <?php echo $selectbank;?> ><?php echo $row['bank']; ?></option>
       <?php
      }
urtrivedi 276 Nearly a Posting Virtuoso

any how if we write some code, but you can not be sure, that it will pick right amount.
do you have any other website source with better html display elements?

urtrivedi 276 Nearly a Posting Virtuoso

is it on live server or on your computer?
and if u click refresh its stays to same qustion or it moves to next question?

urtrivedi 276 Nearly a Posting Virtuoso

SELECT * FROM cms_vouchers where voucher_code =0;

this query will show only vouchers not used

urtrivedi 276 Nearly a Posting Virtuoso

what u showing above is ur compolete code, or still u have anything more

urtrivedi 276 Nearly a Posting Virtuoso

you place limit 1 in your query so it is giving only 1 record in output

u check that query, does in mysql (may be phpmyadmin) runs and gives 2 record or 1

urtrivedi 276 Nearly a Posting Virtuoso

what you asking is called embeding, simple php or simple html can not work alone

see sample embeded code here. this page must be named with extenstion .php

<html>
<?php 
//some php processing, it could be anythingin php, may be database fetch or vriables
$myname="hello";
$myaddress="someplace";

?>

<body>

<div id='putpagehere'>
Name:
<?php
echo $myname;
?>
<br>
Address:

<?php
echo $myaddress;
?>
</div>
</body>
</html>

One can not teach you in forum. we can help to solve ur problems.

urtrivedi 276 Nearly a Posting Virtuoso

this sounds diffcult to pick right amount, because format is not fixed.

urtrivedi 276 Nearly a Posting Virtuoso

are u keeping it (footergray in body or its in another div)

urtrivedi 276 Nearly a Posting Virtuoso

$evaluationid

this may be blank or not set, check how u set $evaluationid

urtrivedi 276 Nearly a Posting Virtuoso

add this 2 also
left: 0px;
width: 100%;