urtrivedi 276 Nearly a Posting Virtuoso

1) I am adding following code to line number 13 as

<div id='showrateimg'>

2) I am adding follwing code to line number 57

</div></td>

3) I am rewriting your success function

  success: function() {
                        $('#div_show').text('You have rated ' + movie_title_s + ' at a ' + movie_rating_s).show('fast');

//additional code

        $("#showrateimg").html("&nbsp;");

        for(i=1;i<=movie_rating_s;i++)
        {
                     $("#showrateimg").append("<img src='beer_mug_finish.jpg'  alt='' width='50' height='50'>");
                }





            },
urtrivedi 276 Nearly a Posting Virtuoso

I dont think simple javascript code can do that. I am not sure jquery can do that or not.

Simply why dont you keep both descripion and code in the option display value together.

<option value='ls2'>Solution Department (ls2)</option>
urtrivedi 276 Nearly a Posting Virtuoso
<?php

    function printvalue($val)
    {
         if($val>1)
               printvalue($val-1);
          echo $val."<br>";
         return;
    }

    printvalue(100);
?>
urtrivedi 276 Nearly a Posting Virtuoso

i Hope sysadmin/sysadmin may work

urtrivedi 276 Nearly a Posting Virtuoso

Just looking problem statement and code, no body can guess what you trying to do. Describe your problem precisely

urtrivedi 276 Nearly a Posting Virtuoso

Try to keep separate logic for updation and html form. so upto line 53 keep code in process.php
later part keep in same file.
In form action, call process.php

urtrivedi 276 Nearly a Posting Virtuoso

Try to keep separate login for updation and html form. so upto line 53 keep code in process.php
later part keep in same file.
In format action call process.php

urtrivedi 276 Nearly a Posting Virtuoso

@TKO You could have added to code snippets.

urtrivedi 276 Nearly a Posting Virtuoso

You may try this code

    <?php
    $userprofile= $_SESSION['name'];
    $sql = mysql_query("SELECT a.Playername, a.Rating,b.avg_rating FROM userrating a left outer join (select Playername,avg(Rating) avg_rating from userrating group by Playername) b on a.Playername=b.Playername WHERE a.Ratedby = '$userprofile'");
    echo "<table>
            <tr>
            <th> Name </th>
            <th> My Rating </th>
            <th> Average Rating </th>
            </tr>";
     while ($row = mysql_fetch_array($sql)){
            echo "<td align=center>" . $row['Playername'] . "</td>";
            echo "<td align=center>" . $row['Rating'] . "</td>";
            echo "<td align=center>" . $row['avg_rating'] . "</td>";                 
            echo "</tr>";
            }
     echo "</table>";
    ?>
urtrivedi 276 Nearly a Posting Virtuoso

REPROGRAM EVERYTHING AND USE DATABASE TABLE FOR CONDITIONS VALUES

urtrivedi 276 Nearly a Posting Virtuoso

I generally use standard editor like notepad/ wordpad
1) copy whole code
2) copy that start quote smart character
3) open find /replace utitlity
4) paste that charcter in find
5) type quote charter in replace
6) click replace all
7) repeat 1-6 for end quote smart character

urtrivedi 276 Nearly a Posting Virtuoso

remove line 20 and copy it to line number 18 (declare image outside swap funciton like you do for frame variable)

var image = document.getElementById("the_image");
urtrivedi 276 Nearly a Posting Virtuoso

I think problem is in code editor

urtrivedi 276 Nearly a Posting Virtuoso

change it to (with only 2 = sign)

if($quantity==0 || trim($quantity)=="")
{
.
.
.
}
urtrivedi 276 Nearly a Posting Virtuoso

I assume that id is auto increment.
I am not sure about performance, but this way you can try updting 1x using only 1 query

insert into 1x (id, domain) select id, domain from 2x where domain not in (select domain from 1x);

Now we assume that all rows from 2x is copied to 1x so we can remove all rows from 2x

delete from table2x;
urtrivedi 276 Nearly a Posting Virtuoso

you are trying to insert wordid in wordid1 or wordid2 which do not exites in table words

urtrivedi 276 Nearly a Posting Virtuoso

while ($row = mysql_fetch_array($result))

Is used after select statment to display/process selected reords, but you have inserted record not selecte before while loop. So you need one more select statment before while loop.

urtrivedi 276 Nearly a Posting Virtuoso

You need to write your own code for retriveing from mysql. LIke you do to format data to html. Same way you fetch data and use tcpdf funtions to format your pdf file.

tcpdf is advance and If you look at tcpdf examples, you will find almost all kind of examples. I am sure your case will fit into one of them.

urtrivedi 276 Nearly a Posting Virtuoso

whereever you want to use session, you must begin your code with

session_start();

Otherwise you can not access session values.

urtrivedi 276 Nearly a Posting Virtuoso

I would suggest to keep conditions and slab in mysql table rather than php.

urtrivedi 276 Nearly a Posting Virtuoso

in the begnining of the script write this 2 lines.

  <?php
  set_time_limit(1200);
 ignore_user_abort(true);
 ?>

This script will run for 20 mintes (1200 seconds), default max time is 30 seconds. Due to second line, script will continue running even user close or stops browser.

urtrivedi 276 Nearly a Posting Virtuoso

$arruserid[] is used to automatically call append new useid value to array , it will give index itself from 0,1,2....n

it is similar to following code

$i=0;
 while($result =mysql_fetch_array($query2))
 {
   $arruserid[$i]=$result['userid'];   
   $i++;
 }
urtrivedi 276 Nearly a Posting Virtuoso

This is how I used to do in such situation.
1) create one form with hidden fields.
2) on click the link I call javascript function
3) functions sets hidden value to the passed value.
4) submit form (post method)
5) use post array in the action page.

Page 1

<script lang='javascript'>
function showprofile(usrid)
{
doucment.getElementById('uid').value=usrid;
document.frm.submit();
}

</script>

 <a href="javascript:showprofile('<?php echo $user?>')">click here</a>

<form action='profile.php' method=post id=frm name=frm>
<input type=hidden id=uid name=uid >
</form>

Page 2 (profile.php)

 <?php
       $userid=$_POST['uid];
       echo $userid;
       .
       .
       .
 ?>
urtrivedi 276 Nearly a Posting Virtuoso

Yes I felt such problem some times back.

Refer this link
http://www.rgagnon.com/jsdetails/js-0129.html

urtrivedi 276 Nearly a Posting Virtuoso

You can set form method to post see example

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

urtrivedi 276 Nearly a Posting Virtuoso

I have changed line 16, 20 and 26 yof your code above.
1) In 16 you are fething your row only once, you need loop through query2 result.
2) In 20 now I am using new array I set in loop, to implode.
3) In 26 I have removed single quotes around $string variable.

<?php
$username = $_COOKIE['user'];
@mysql_connect ("localhost","down2par_down2pa","4m329aMh") or die ("could not connect to MySQL");
@mysql_select_db ("down2par_d2pdb") or die ("no database");
$query1 =mysql_query("SELECT * FROM login WHERE username = '$username'");
$user = mysql_fetch_array($query1);
$admin = $user['admin'];
if ($admin==1){
//get user id from "approval" database 

$query2 =mysql_query("SELECT * FROM approval WHERE approved = '0'");
unset($arruserid);

while($result =mysql_fetch_array($query2))
{
  $arruserid[]=$result['userid'];   

}
//turn array of ids into a string
$string = implode(" OR id =", $arruserid);


get total number of users
$numrow = mysql_num_rows($query2);
//use string to get users details from "login" database
$query =mysql_query("SELECT * FROM login WHERE id =$string");






echo ('
<html>
<head>
<style type="text/css">
td {
//padding-left: 10px;
//padding-right: 10px;
}
table {
border: solid grey 2px;
margin: 5px;
}
</style>
</head>
<h1> ads for approval: ' . $numrow . ' </h1> 
('.$string.') ');
print_r($result); 
echo('
<br><br>
');
while ($result=mysql_fetch_array($query)) {
echo ('
<table width="35%">
        <tr>
                <td width="20%"><p>user: </p>' . $result['username'] . ' </td> 
                <td width="20%"><p>club: </p>' . $result['club'] . ' </td> 
                <td width="20%"><p>city: </p>' . $result['city'] . ' </td> 
                <td width="20%"><p>night: </p>'. $result['night'] . ' </td> 
                <td width="20%"> <a href="home.php"> Approve</a> </td> 
        </tr>
</table>
<hr>
');
}
echo ('
<a href="http://www.down2party.com/Nathan/home_page/loginpage.php">Return to …
urtrivedi 276 Nearly a Posting Virtuoso

I hope this works.

update [rotadb].[dbo].[Rota],[rotadb].[dbo].[RotaBos], [rotadb].[dbo].[RotaBa],[dentime].[dbo].[den]

  set [rotadb].[dbo].[Rota].[ldchangetime] = [dentime].[dbo].[den].[time] 

where [rotadb].[dbo].[Rota].[pRotaBos] = [rotadb].[dbo].[RotaBos].[Rotabos_rowid]

and [rotadb].[dbo].[RotaBos].[pRotaBa]=[rotadb].[dbo].[RotaBa].[RotaBa_rowid]

and [rotadb].[dbo].[RotaBa].[skod]= [dentime].[dbo].[den].[skod]
urtrivedi 276 Nearly a Posting Virtuoso

You need to use 2 separate queries. Current query will give distinct combination of 2 colums

 SELECT DISTINCT  category FROM product WHERE subcategory = '$subcategory'

  SELECT DISTINCT brand FROM product WHERE subcategory = '$subcategory'
urtrivedi 276 Nearly a Posting Virtuoso

Calculation of grade must be one time process and it must be done by faculty or administrator, in that process it should store calculated grades in some table.

Then that calculated grades can be shown to students any other who knows roll number.

urtrivedi 276 Nearly a Posting Virtuoso

1) Do you want to update database in the process form. (you did not mention form action and form method)

2) You can also keep hidden value before button element may be id of table or email id or user id which ever is primary key of table, so that hidden value is also posted with submit

3) no need of $i name in button name/id as you are using sepearte form element for each button pair (accept/reject). You can keep same name (that will make your work easy in action page.

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

use null value as place holder

select t1col1 as col1, t1col2 as col2, t1col3 as col3 from t1
union
select null as col1, t2col2 as col2, t2col3 as col3 from t2
union
select t3col1 as col1, t3col2 as col2, null as col3 from t3
urtrivedi 276 Nearly a Posting Virtuoso

if userid is numeric then ur query is fine, but if user id is text then u must enclose value with single quote.

$query="INSERT INTO gamescores (userID, visitScore) 
VALUE ('$formUser', $points)";

$query2="UPDATE gamescores SET userID='$formUser', visitScore=$points";
urtrivedi 276 Nearly a Posting Virtuoso

You can use union statment to merge multiple query result in one.
But take care all queries must have same number of columns and of same type from proper output

SELECT DISTINCT  'country' coltype, dbo.Add_Employees.country colvalue, COUNT(Add_Employees.employee_uniqueId) AS total FROM dbo.Add_Employees
	  GROUP BY(Add_Employees.country)

UNION

SELECT DISTINCT  'city' coltype, dbo.Add_Employees.city colvalue, COUNT(Add_Employees.employee_uniqueId) AS total
	  FROM dbo.Add_Employees
	  GROUP BY(Add_Employees.city

)
urtrivedi 276 Nearly a Posting Virtuoso

change this line and see the result

<select id="drop_1" name="country" onChange="CompanyNameCBtoTB();autoSubmit();">

urtrivedi 276 Nearly a Posting Virtuoso

You already have value in drop1 and drop2, then why you want to save same value in another textbox. What is the use?

urtrivedi 276 Nearly a Posting Virtuoso

You planning to do it in phpmysql?

urtrivedi 276 Nearly a Posting Virtuoso

NO it cant go wrong, becuase even last_inert_id gives value as per connection, but value is unique for table. Just you need to be careful in setting primary key , foreign key in your table to avoid insertion of duplicate recrods

urtrivedi 276 Nearly a Posting Virtuoso

You can look joomla,wordpress, magento(inventory/store) demos on their sites for crm. I am not sure about ERP.

urtrivedi 276 Nearly a Posting Virtuoso

your result tables are not good, you can have only one result table with column class code in it.

you must say table name as
student_result (resultid, classcode, ...... other columns)

where class code can be one, two, nursary like that

urtrivedi 276 Nearly a Posting Virtuoso

I suggest you to break up all problem in 10 threads one by one, because as discussion progresses, it will be difficult to handle all 10 problemns in one thread.

Start with most important question, Also post next question after previous is solved.

urtrivedi 276 Nearly a Posting Virtuoso

Print_r can only show dump values.
You can try following code to show values on screen in better manner.

<?php 
echo "<table>";
echo "<tr>";

echo "<td>ID</td>";
echo "<td>First Name</td>";
echo "<td>Last Name</td>";
   
echo "</tr>";
for ($i=0;$i<count($mysql->arr2);$i++)
{
   echo "<tr>";

   echo "<td>{$mysql->arr2[$i]['id']}</td>";
   echo "<td>{$mysql->arr2[$i]['first_name']}</td>";
   echo "<td>{$mysql->arr2[$i]['last_name']}</td>";
   
   echo "</tr>";
}
echo "</table>";
?>

or still you want to use print_r, then use following code

<?php 

for ($i=0;$i<count($mysql->arr2);$i++)
{

   echo "<pre>";   
   print_r($mysql->arr2[$i]);
   echo "</pre>";
}

?>
urtrivedi 276 Nearly a Posting Virtuoso

upload all php file used in this page, with sql data structure and sample data. so that we can have complete look to script.

urtrivedi 276 Nearly a Posting Virtuoso

following is the sample,
you can have 2 forms and onclick you can use javascript fuction to post your values to xyz.php.

<script lang='javascript'>
function delete_record(id,act)
{
   
   document.getElementById('ID').value=id;
   document.getElementById('action').value=act;
   document.actionform.submit();
}
<script>
<form name='actionform' id='actionform' action='xyz.php' method='post'>
<input type='hidden' name='ID' id='ID'>
<input type='hidden' name='action' id='action'>
</form>
</form>

<form name='mainform' id=mainform action='somepage.php'  method='post'>
rec 1<a onclick="javascript:delete_record(123,'delete');">Delete</a><br>
rec 2<a onclick="javascript:delete_record(124,'delete');">Delete</a><br>
rec 3<a onclick="javascript:delete_record(125,'delete');">Delete</a><br>
</form>
karthik_ppts commented: Useful post +7
urtrivedi 276 Nearly a Posting Virtuoso

If you are not going to use data after one year, at the end of year, can trunc year old data. to keep on required rows.
I think mysql will handle millions rows without any problem.

urtrivedi 276 Nearly a Posting Virtuoso

I dont know how your query is working, because column list and group by list is not matching in your query.

to find min only by arline

$sql="SELECT MIN(price),airline FROM faresheet WHERE cabin = '".$q."' AND des = 'DEL' GROUP BY airline ORDER BY MIN(price) ASC";

to find min only by arline and season

$sql="SELECT MIN(price),airline,season FROM faresheet WHERE cabin = '".$q."' AND des = 'DEL' GROUP BY airline,season ORDER BY MIN(price) ASC";
urtrivedi 276 Nearly a Posting Virtuoso

If possible then you must refer to country id rather than country code, I means I think numerice referece will perform better than varchar reference.

If that is not possible then, Also create key for short_code in both table (country and city table)

urtrivedi 276 Nearly a Posting Virtuoso
$query="SELECT a.id as club_id,
       a.fr_name as club_name, 
       b.id as nation_id,
       b.fr_name as nation_name,
       c.id as player_id,
       c.fr_fname as player_name
     FROM fr_clubs as a 
    INNER JOIN fr_nations as b ON a.id = b.club_id
    INNER JOIN fr_players as c ON b.id = c.nation_id
     LIMIT ". $paginate->start .",". $paginate->limit
urtrivedi 276 Nearly a Posting Virtuoso

I think you can download only those tables that you want to use in select query. Whole database is not required. So that will be less in size.

Another way is through php, it can be done by just looping through table, comparing then inserting. (I think no server will restrict you doing that).

urtrivedi 276 Nearly a Posting Virtuoso

What I can suggest is.
1) Download database copy from live server.
2) Set up database in your local pc in mysql.
3) Note the last record in your main table where you want to add 670 rows.
4) Now run script locally and insert new records in local database (copy of live).
5) export new records to sql script (simple insert command)
6) run script of new records on live server