urtrivedi 276 Nearly a Posting Virtuoso

we must practise to do it in correct format. Better you use <br /> <img />. Though it will not change layout, if you do not add space and slash.

urtrivedi 276 Nearly a Posting Virtuoso

I have tried to create a query like it is expected in excel file

give mysql login parameter to this file

save that file as php and run it

urtrivedi 276 Nearly a Posting Virtuoso

I am not sure, because I do not know what do you mean when you say, "It does not works".
I think reason could be multiple forms.

urtrivedi 276 Nearly a Posting Virtuoso

can you post your mysql table(S) structure with sample data in sql query format. NOT EXCEL

urtrivedi 276 Nearly a Posting Virtuoso

have you placed <a></a> as I suggested, what happens when you click on that link?
Does it shows proper url with commentid in broswer statusbar ?

urtrivedi 276 Nearly a Posting Virtuoso

I am not able to trace, but I think you must separate clientdata calling from other part.
call it separately.

Also eval() is also not working. so you must find another way of setting html elements other than eval.
I have never used jquery -ajax so I am not able to debug it,
For ajax i use XAJAX libraries

urtrivedi 276 Nearly a Posting Virtuoso

after keeping backup, i suggest you to run without where condition.

urtrivedi 276 Nearly a Posting Virtuoso

are you getting expected number of records by selecting it
say

select count(*) from quest_bank where source like '%src="~/%'

I think you might be having space in between in some records [ src = "~/ ] like that

urtrivedi 276 Nearly a Posting Virtuoso
select col1,col2,col3 from tablename where col1='something' and col4='some more thing'
urtrivedi 276 Nearly a Posting Virtuoso

Are you able to display it

echo '<td align="center" >'.$row['commentId'].'</td>';

If no then check the spelling and case, php array is case sensitive.

Another thing is that you have placed form in the loop, I think it is not required, you can simply use <a></a>\

replace your delete code

echo '<form action="delete.php?cmId='.$cmId.'">';
       
            echo '<td align="center" >'.'<input type="submit" value="Del" name="" />'.'</td>'.'<tr>';
           //  echo "ID".$row['id']."<$> ".$row['title']." ".$row['popst'];
            echo ' </form>';

by following code

$cmId=$row['commentId'];
echo "<td align='center' ><a href='delete.php?cmId=".$cmId."' >Delete</a></td></tr>;";

at line 17 bring tbody tag out of loop

urtrivedi 276 Nearly a Posting Virtuoso

Following is the code for expected output, it is not compiled you may have to correct syntax error if any. Before running code, check whether query runs in your phpmyadmin or not.

<?php
$orgname="SCSW";

$querymain="SELECT C1.GroupID,
sum(if(MONTH(C1.logtime)=1,1,0))  Jan, 
sum(if(MONTH(C1.logtime)=2,1,0))  Feb, 
sum(if(MONTH(C1.logtime)=3,1,0))  Mar, 
sum(if(MONTH(C1.logtime)=4,1,0))  Apr, 
sum(if(MONTH(C1.logtime)=5,1,0))  May, 
sum(if(MONTH(C1.logtime)=6,1,0))  Jun, 
sum(if(MONTH(C1.logtime)=7,1,0))  Jul, 
sum(if(MONTH(C1.logtime)=8,1,0))  Aug, 
sum(if(MONTH(C1.logtime)=9,1,0))  Sep, 
sum(if(MONTH(C1.logtime)=10,1,0))  Oct, 
sum(if(MONTH(C1.logtime)=11,1,0))  Nov, 
sum(if(MONTH(C1.logtime)=12,1,0))  Dec,
count(*) total
tablename as C1
where orgname='{$orgname}'
GROUP BY  C1.GroupID ";

$resultmain=mysql_query($querymain);
echo "<table>";
echo "<tr><td>group</td>  <td>jan</td>  <td>feb</td>................. <td>Grand total</td>  </tr>";
while($rowmain=mysql_fetch_array($resultmain))
{


   echo "<tr><td>{$rowmain['GroupId']}</td>  <td>{$rowmain['Jan']}</td>  <td>{$rowmain['Feb']}</td>.................<td>{$rowmain['total']}</td>   </tr>";

   $querysub="SELECT C1.GroupName ,
   sum(if(MONTH(C1.logtime)=1,1,0))  Jan, 
   sum(if(MONTH(C1.logtime)=2,1,0))  Feb, 
   sum(if(MONTH(C1.logtime)=3,1,0))  Mar, 
   sum(if(MONTH(C1.logtime)=4,1,0))  Apr, 
   sum(if(MONTH(C1.logtime)=5,1,0))  May, 
   sum(if(MONTH(C1.logtime)=6,1,0))  Jun, 
   sum(if(MONTH(C1.logtime)=7,1,0))  Jul, 
   sum(if(MONTH(C1.logtime)=8,1,0))  Aug, 
   sum(if(MONTH(C1.logtime)=9,1,0))  Sep, 
   sum(if(MONTH(C1.logtime)=10,1,0))  Oct, 
   sum(if(MONTH(C1.logtime)=11,1,0))  Nov, 
   sum(if(MONTH(C1.logtime)=12,1,0))  Dec,
   count(*) total

   tablename as C1
   where orgname='{$orgname}' and groupID='{$rowmain['GroupID']}'
   GROUP BY  C1.GroupName ";



   $resultsub=mysql_query($querysub);
   while($rowsub=mysql_fetch_array($resultsub))
   {
	   echo "<tr><td>{$rowsub['GroupName']}</td>  <td>{$rowsub['Jan']}</td>  <td>{$rowsub['Feb']}</td>.................<td>{$rowsub['total']}</td>   </tr>";	 

   }
}
echo "</table>";
?>
urtrivedi 276 Nearly a Posting Virtuoso

Now you know that your script is giving code, so now stop echoing sql and other variables only you should echo javascript statement, because when u eval(response), it will expect javascript code not any other. so comment unwanted things.

also you upload your whole form page that is having ajax funtion here, I will give a try.

urtrivedi 276 Nearly a Posting Virtuoso

this is expected output
groupname jan feb march....
A 3 1 2
B 1 4 5

then post table structure and sample data here

urtrivedi 276 Nearly a Posting Virtuoso

I think this is not good way of entering date
check jqueryui datepicker its very simple to use, in your case how you will validate date

any way for your case
you must give name and ids to all elements like

<input ....  name='d1' id='d1' >
<input ....  name='d2' id='d2' >
<input ....  name='m1' id='m1' >
<input ....  name='m2' id='m2' >
<input ....  name='y1' id='y1' >
<input ....  name='y2' id='y2' >
<input ....  name='y3' id='y3' >
<input ....  name='y4' id='y4' >

when it is submitted to php process page it must build date there

<?php
$dateval=$_POST['y1'].$_POST['y2'].$_POST['y3'].$_POST['y4']."-".$_POST['m1'].$_POST['m2']."-".$_POST['d1'].$_POST['d2']

$insertquery="insert into table (mydate) values ($dateval)";

?>
urtrivedi 276 Nearly a Posting Virtuoso

this will alert user to enter proper string which may or may not start with +

function zz(txt)
{

   isPhone     = /^[+]?\d+$/;

   if (!isPhone.test(txt))
   {
    alert('Invalid phone number');
    document.getElementById('aa').focus();
    return false;
   }
   return true
}
urtrivedi 276 Nearly a Posting Virtuoso

if its one time you can export it to excel or csv then import it in oracle

or you can develop some front end in vb.net or php and connect to both database and transer data from one to another database

urtrivedi 276 Nearly a Posting Virtuoso

Basic php
http://www.w3schools.com/php/default.asp
PHP TUTORIAL
http://devzone.zend.com/node/view/id/651

There are so many ready to use free tools (framework)
joomla, wordpress, drupal, cakephp and so many more, but you must learn basic php first.

urtrivedi 276 Nearly a Posting Virtuoso

rename for
function all
to
function allnew (i think all is inbuilt keyword)

urtrivedi 276 Nearly a Posting Virtuoso

I have tested this code, its running fine here
make sure you pass getClientId and your post method is get, Be sure about case sensitivity of variable name C and I should be capital and rest letters in small

when I open link

http://server/folder/page.php?getClientId=DG9642

It gives following output

MY SQL = SELECT ad.firstname, ad.lastname, ad.address, ad.city, ad.state, ad.zipcode, ad.dhtmlgoodies_category, ad.dhtmlgoodies_subcategory, ad.caryear, ad.customerid, ad.servicedesc, aj.email, aj.areacode, aj.phoneprefix, ad.clientID, aj.phonesufix, aj.cellareacode, aj.cellprefix, aj.cellsufix, aj.commentonclient FROM additional_cars as ad, ajax_client as aj WHERE ad.clientID='DG9642' group by ad.clientID
formObj.firstname.value = 'Mossa'; formObj.lastname.value = 'Barandao'; formObj.lastname1.value = 'Barandao'; formObj.address.value = '6572 Park Fifth Ave'; formObj.zipcode.value = '22384'; formObj.city.value = 'New York'; formObj.state.value = 'NY'; formObj.dhtmlgoodies_category.value = 'JAGUAR'; formObj.dhtmlgoodies_subcategory.value = 'X-TYPE'; formObj.caryear.value = '1988'; formObj.servicedesc.value = '\nOn June 30, 2011, 9:55 am\nWe performed the following:\nServiced Area: Exhaust \nService Details:\n\nexshaust\n\nMileage @ Service: 4334\n\n----End of Service Report----\n\nOn June 24, 2011, 2:48 pm\nWe performed the following:\nServiced Area: Driveshaft & Axle \nService Details:\n\ntest\n\nMileage @ Service: 5634\n\n----End of Service Report----\n\nOn June 22, 2011, 4:39 pm\nWe performed the following:\nServiced Area: Clutch , Driveshaft & Axle , Suspension \nService Details:\n\ntest\n\nMileage @ Service: 6377\n\n----End of Service Report----\n\nOn June 21, 2011, 12:31 pm\nWe performed the following:\nServiced Area: Air Intake , Brake , Oil Change , Engine Mechanical , Steering , Transmission \nService Details:\n\ntest\n\nMileage @ Service: 4343\n\n----End of Service Report----\n\nOn June 20, 2011, 11:05 am\nWe performed the following:\nServiced Area: Clutch , Engine Mechanical , Steering \nService Details:\n\ntest\n\nMileage @ Service: 4343\n\n----End of Service Report----\n\nOn April 18, 2011, 9:43 am\nWe performed …

urtrivedi 276 Nearly a Posting Virtuoso

when you run this page in browser, then, if you right click on broswer, it will show VIEW SOURCE OPTION (THAT WILL SHOW HTML CODE). depending on browser one or another way you will find such menu.

when you loook at html code in search text type MY SQL =

then following you will find query, copy it then run it in phpymadmin
this is to check whether your php page is builing query properly or not

urtrivedi 276 Nearly a Posting Virtuoso

check my code line numbers
389 given id to form
393 given id to num
395 changed submit to button and added onclick event
404 removed duplicate form
470 accessing num by id
502 change function definition, now creating new function totext
507 accessing num by id

<html>

<style type="text/css">
.M {
text-align: center;
font-family: "Arial Black", Gadget, sans-serif;
font-size: 36px;
}
.J {
text-align: center;
}
.J {
text-align: center;
}
.Q {
text-align: right;
color: #333;
}
.D {
text-align: right;
}
.J strong {
font-size: 18px;
}
.J strong {
font-size: 24px;
}
.J strong {
font-size: 18px;
}
.J strong {
font-size: 16px;
}
.J strong {
font-size: 18px;
}
.P strong {
text-align: center;
}
.P {
font-size: 18px;
}
.E strong {
font-size: 18px;
}
.E {
font-style: italic;
}
.E {
font-weight: bold;
font-size: 18p&nbsp;&nbsp;&nbsp;&nbsp;<p class="J"><strong>Email:www.Multifactor.us
&n
;
}
.E .E {
font-style: normal;
}
.E .E {
font-weight: normal;
}
.P {
font-size: 16px;
}
.E {
text-align: center;
font-style: normal;
font-weight: normal;
}
.P {font-size: 18px; text-align: center;}
.E {
font-weight: bold;
font-size: 14px;
}
.E {
font-size: 10px;
}
.E {
text-align: center;
}
.P {
font-weight: bold;
}
.w {
font-size: 20px;
}
.d {
text-align: right;
}
.t {
text-align: left;
}
.n {
font-size: 16px;
}
.n {
font-size: 18px;
}
.d {
font-size: 18px;
}
.q {
font-size: 18px;
}
.t {
font-size: 18px;
}
.t1 {
font-size: …
urtrivedi 276 Nearly a Posting Virtuoso

after running page view souce and search for MY SQL =
I think you should find real query text around it in source. then run that query in myadmin.

urtrivedi 276 Nearly a Posting Virtuoso

gd library can not connect the boxes, you are going to build logic for it. You must know the position and width of boxex, you can write text using gd. just you have to work with coordinatest, so roughly on paper graph draw your design and create images using php gd function.

urtrivedi 276 Nearly a Posting Virtuoso

bibiki, if your db structure is like tree, the you may can create tree kind of structure using javascript-php, so many such scripts are available on net.

urtrivedi 276 Nearly a Posting Virtuoso

I think you can use gd libraries. You can draw rectangles and lines using it using php code. gd must be installed on your server with php.

urtrivedi 276 Nearly a Posting Virtuoso

I have merged template in your code, I think following 3 variable are important for your payment gateway. Do not include template code now. (its already in your code now)

$sngTotal=0.0;
$strBasket="";
$iBasketItems=0;

Final code

<?php 		

$sngTotal=0.0;
$strBasket="";
$iBasketItems=0;
$total=0;

foreach($_SESSION['cart'] as $product_id => $quantity) 
{
	$query = sprintf("SELECT * FROM all_products WHERE part_number = '%s';",$product_id);  
									
	$result = mysql_query($query)or die(mysql_error());
	$num = mysql_num_rows($result); 
									
	if(mysql_num_rows($result) > 0) 
	{
	  list($id, $part_number, $price) = mysql_fetch_row($result);
	
	  $iBasketItems=$iBasketItems+1;							
	  $line_cost = $price * $quantity;
	  $total = $total + $line_cost;	

	  $strBasket=$strBasket . ":" . $product_id . ":" . $quantity;
   	  $strBasket=$strBasket . ":" . number_format($price,2); /** Item price **/
	  $strBasket=$strBasket . ":" . number_format($price*$quantity,2); /** Line total **/
								
	}
}
$sngTotal=$total;
?>
urtrivedi 276 Nearly a Posting Virtuoso

post your algorithm here.

urtrivedi 276 Nearly a Posting Virtuoso

Even some database do not allow to change type especially when table having data, or it is key column.

In your case if it is PK then when u change PK's datatype you will also have to change datatype of its foreign key reference.

I suggest if it is going to cross SMALLINT range then better to use MEDIUMINT in the begining.

urtrivedi 276 Nearly a Posting Virtuoso

carefully use this code, before running this query, keep back up of table

mysql_query("UPDATE narr_weinachtfeier SET albumdescription='$change_name',
location=  concat('$change_name',substr(location,instr(location,'/'))) ,
location1=  concat('$change_name',substr(location1,instr(location1,'/')))
WHERE id='$idalb'"
urtrivedi 276 Nearly a Posting Virtuoso

I think using browser is not possible. You need to develop desktop application, which to be installed at all client.

Still browser javascript NAVIGATOR.useragent object gives certain information (not hardware). You may try this, but not completely solve your problem.

urtrivedi 276 Nearly a Posting Virtuoso

category(cat_id, cat_desc)
article(art_id,art_desc, cat_id)
user(userid, username,pwd)
user_category(userid, cat_id)
user_mail_log(log_id,userid,art_id,sent_time) optional

here when an article is added you can run query and loop it to send mail to user subscribed its category and save that log in user_mail_log table (optional).

to find out you need to join article, user, category and user_category table

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

It is little difficult not impossible, because you are trying to breach security. So if you want it for small intranet where clients pcs are under your control there you can do it using activex controls.

urtrivedi 276 Nearly a Posting Virtuoso

this query returns those id, name from table1 which id are not referred either in sup_id or in emp_id

select id, name from table1 t1
left outer join table2 t2s on t2s.sup_id=t1.id
left outer join table2 t2e on t2e.emp_id=t1.id
where ifnull( t2s.sup_id,0)+ ifnull(t2e.emp_id,0)=0
urtrivedi 276 Nearly a Posting Virtuoso

I have added new php code in <tr> tag

while ($rc = mysql_fetch_array($my)) 
                    {
    
                    
                        //Display the data in HTML tables
                   //     while ($re = mysql_fetch_array($rd)) {
                             ?>
                       	<tr
						   
						   <?php
						   
						$arrival=strtotime($rc['arrival_at']);
						$deadlinetime=strtotime('9:15 am');

					   if($arrival>$deadlinetime || date("d-m-y",$arrival)=="01-01-70")//second condition is if time is not in valid format
					   {
					    	echo "style='font-weight:bold; background-color:red'";
						} 
						else 
						{
						 echo "style='background-color:#DDDDDD'";
						} ?> 
						
						>  
						   
						   
						       
                        <?php 
                        echo "<td>" . $rc['user_name'] . "</td>";
                   //     }
                        echo "<td>" . $rc['date'] . "</td>";
                        echo "<td>" . $rc['arrival_at'] . "</td>";
                        echo "<td>" . $rc['left_at'] . "</td>";
                        echo "<td >" . $rc['late_reason'] . "</td>";
                        echo "<td >" . $rc['system_ip'] . "</td>";
                        echo "</tr>";
                    }
urtrivedi 276 Nearly a Posting Virtuoso

inserted where?
In database or in textbox you want to read hardware information.

urtrivedi 276 Nearly a Posting Virtuoso

i think you want to join tables.

query for joining two table is as follows

select t2.sup_id, t1s.name sup_name, t2.emp_id, tle.emp_name 
from table2 t2 
left outer join table1 t1s on t2.sup_id=t1s.id
left outer join table1 t1e on t2.emp_id=t1e.id
urtrivedi 276 Nearly a Posting Virtuoso
What I need to do is take the date clause from the views and instead use it in the query so that I can re-use the views with other date ranges.

You are in the right direction
remove this line from both views

AND DATE BETWEEN '2010-08-01' AND  '2011-05-01'

now add where condition in your query

.
.
.
LEFT JOIN view2 on view1.player_id=view2.player_id 
where  view1.DATE BETWEEN '2010-08-01' AND  '2011-05-01'
and view2.DATE BETWEEN '2010-08-01' AND  '2011-05-01'

ORDER BY lminpg ASC

Here you can set date dynamically using php post or get variable

IF above gives you unexpected result then you need to recode your view by only joining tables in view and then in your php code you count/sum and group those views.

If you count/sum in the viewitself you will not able to filter result by date properly.

urtrivedi 276 Nearly a Posting Virtuoso

IF you have php installed on that server you can do this thing by using php script (need to be developed according to your requirements).

urtrivedi 276 Nearly a Posting Virtuoso

Are you sure all columns are in the format hh:mi am/pm or or does it somewhere exist time in 24 hour format.

urtrivedi 276 Nearly a Posting Virtuoso

Can u check how much time this query takes.

select 
	N.id,
	N.Alias,
        N.Weight
FROM
	Ninja N left outer join  Matchup Mb on 	Mb.BlueCornerNinjaID = N.id
left outer join  Matchup Mr on 	Mr.RedCornerNinjaID = N.id


WHERE ifnull(Mb.BlueCornerNinjaID ,0)+ifnull(Mr.BlueCornerNinjaID ,0)>0
ORDER BY
	N.Alias
urtrivedi 276 Nearly a Posting Virtuoso

what is the datatype of arrival_at, its datetime or time or varchar.

If its varchar then you need to cast it to time before comparing. So mention here how you store your arrival_at.

urtrivedi 276 Nearly a Posting Virtuoso

instead of using load file, you directly read file using php and insert records directly to mysql.

while reading file in code, if you find blank country, then you may set country to country of previous record.

d5e5 commented: Good advice. Need to pre-process data with procedural language, such as php or Perl. +9
urtrivedi 276 Nearly a Posting Virtuoso

Before you upload you file, you must complete the record, you can not pass blank country. Human can read file and understand that to which country that blank city belong after looking the top row of city group. But computer can not understand that.

Try to attach following file with comma as delimiter

urtrivedi 276 Nearly a Posting Virtuoso

I do not have such demo code right now. but I will post it when I manage to make a demo.

urtrivedi 276 Nearly a Posting Virtuoso

it needs double ==

if(mysql_result($result,0)==1)
urtrivedi 276 Nearly a Posting Virtuoso

It is possible same form and one action page by using complex javascript coding.
You need to learn html element arrays
1) like Naming html elements using xyz[],
2) Adding /deleting table rows using javascript code.
3) accessing posted array in php and all that.

If updating all at once is not mandatory then phpdatagrid 4.3.1 (free) is good tool for updating table data.
This tools handles all opertion (add/edit/delete/copy). You just have to intialize the tool object by required parameters

urtrivedi 276 Nearly a Posting Virtuoso

This is little simplified.

<?php
session_start();

$connection=mysql_connect("localhost","root","");
$db=mysql_select_db("bank",$connection);

	
$username = $_POST['username'];
$password = $_POST['password'];
$newpassword = $_POST['newpassword'];
$newpassword = md5($newpassword);
$confirmnewpassword = $_POST['confirmnewpassword'];
$confirmnewpassword = md5($confirmnewpassword);	

$result = mysql_query("SELECT count(*) FROM users WHERE username='$username' and password='".md5($password)."'");
if(mysql_result($result,0)=1) //there must be one combination of user/pass
{
	if($newpassword==$confirmnewpassword) 
	{
	    $sql=mysql_query("UPDATE users SET password='$newpassword' where username='$username'"); 
	    if($sql) 
	    { 
	   	 	echo "Congratulations You have successfully changed your password"; 
	    }
	}
	else
	{ 
		echo "The new password and confirm new password fields must be the same"; 
	}   
}
else
{ 
	echo "Invalid Username/Password"; 
} 


?>
urtrivedi 276 Nearly a Posting Virtuoso

changed if ladder

<?php
session_start();

$connection=mysql_connect("localhost","root","");
$db=mysql_select_db("bank",$connection);

	
$username = $_POST['username'];
$password = $_POST['password'];
$newpassword = $_POST['newpassword'];
$newpassword = md5($newpassword);
$confirmnewpassword = $_POST['confirmnewpassword'];
$confirmnewpassword = md5($confirmnewpassword);	

$result = mysql_query("SELECT password FROM users WHERE username='$username'");
if(!$result) 
{ 
echo "The username you entered does not exist"; 
} 
else
if(md5($password)!=mysql_result($result,0))
{
echo "You entered an incorrect password";
}
else
{
 

if($newpassword==$confirmnewpassword) 
    $sql=mysql_query("UPDATE users SET password='$newpassword' where username='$username'"); 
    if($sql) 
    { 
    echo "Congratulations You have successfully changed your password"; 
    }
else
{ 
echo "The new password and confirm new password fields must be the same"; 
}   

}//i have added this brace //
?>
urtrivedi 276 Nearly a Posting Virtuoso

You may try this part, I think your query is failing. do not change executeQuery now.

function loadArrayFromQuery($query) {
		$result = $this->executeQuery($query);
                if($result)
                {
		   $return = array();
   		   while ($rows = mysqli_fetch_array($result))  //THIS IS THE LINE THAT IS FAILING
		   {	
			   $return[] = $this->loadFromArray($rows);
		   }
		   return $return;
                 }
                 else
                 {
                     echo "some error occured ".mysqli_error($this->link);;
                     die('');
                  }
	}