urtrivedi 276 Nearly a Posting Virtuoso

If you have php manual, than look for curl functions. Its used to access website through your php code. You can also post data and get response from the websites, that you can process on your page.

urtrivedi 276 Nearly a Posting Virtuoso

If you use only one buton and no text box
We may change title of one button using javascript?

urtrivedi 276 Nearly a Posting Virtuoso

what is your server scripting language. php, perl-cgi, asp.net, java or any other.

urtrivedi 276 Nearly a Posting Virtuoso

<input type=button name=btna id=btna value='add' >
<input type=textbox name=txt1 id=txt1 value ='' >
<input type=button name=btnb id=btnb value= 'row to table' >

urtrivedi 276 Nearly a Posting Virtuoso

you must learn something about curl

urtrivedi 276 Nearly a Posting Virtuoso

I think its not possible with normal simple coding, It is somewhat complicated issue, which requires complex javascript code.

Why do you need such thing?

urtrivedi 276 Nearly a Posting Virtuoso

also do not forget to set delimiter to $$

urtrivedi 276 Nearly a Posting Virtuoso

Have you tried my code posted above, I am again posting it.

<?php
$firstday="Tuesday";
$secondday="Saturday";

$today=date("l");

$nextdate1=strtotime("next $firstday");
$nextdate2=strtotime("next $secondday");


if ($today==$firstday || $today==$secondday)
{
	echo "Today: ".date("m-d-Y")."<br>";
}
if ($nextdate1<$nextdate2)
{
	echo "Next: ".date("m-d-Y l",$nextdate1)."<br>";
	echo "Next: ".date("m-d-Y l",$nextdate2)."<br>";
}
else
{
 	echo "Next: ".date("m-d-Y l",$nextdate2)."<br>";
	echo "Next: ".date("m-d-Y l",$nextdate1)."<br>";
}


?>
urtrivedi 276 Nearly a Posting Virtuoso

try to fetch thing only once in php array, and then use that array to intialise report and chart parameters

urtrivedi 276 Nearly a Posting Virtuoso

change your line no 10

$i = 0;

set $i to 1

$i=1;
urtrivedi 276 Nearly a Posting Virtuoso

in line number 314 of config.php, why username, servername, password is not passed?

$msconnect=mysql_connect();

urtrivedi 276 Nearly a Posting Virtuoso

FROM LINE NUMBER 228 above, remove single quote from the end

$googleads='http://www.google.com/'

type as

$googleads='http://www.google.com/
urtrivedi 276 Nearly a Posting Virtuoso

post table structure with sample data and then post expected output,

urtrivedi 276 Nearly a Posting Virtuoso

www.w3schools.com for any web related begining

urtrivedi 276 Nearly a Posting Virtuoso

I was always able to login. But rest problems I faces regularly in recent times.

urtrivedi 276 Nearly a Posting Virtuoso

I hope this would work.

select a.invoice_no, a.max_date,a.total, b.max_document_no 
from (
       SELECT invoice_no, max(document_date) max_date, sum(value) total
       FROM invoice 
       GROUP BY invoice_no
      ) a
inner join 
     (
        SELECT invoice_no,document_date max(document_no) max_document_no
        FROM invoice 
        GROUP BY invoice_no,document_date
     ) b on a.invoice_no=b.invoice_no and a.document_date=b.document_date
urtrivedi 276 Nearly a Posting Virtuoso

It can not be done through pure sql, I guess you want show content of table which is having max number of rows in database. So here your table name is not know to query.

What is your front end. If you can build query dynamically. Then you have to execute two queries one by one.

FIrst one I given you in above post, NOw the top most rows TABLE_NAME is your required table name

Now you can build another query

select * from 'tablename'

I am not sure I am able to explain or not.

urtrivedi 276 Nearly a Posting Virtuoso
select invoice_no, max(doucment_no), max(document_date), sum(value) 
from invoice
group by invoice_no
urtrivedi 276 Nearly a Posting Virtuoso
SELECT TABLE_NAME, NUM_ROWS FROM all_tables WHERE owner='SCHEMANAME' ORDER BY num_rows DESC

1) ALL_TABLES is oracle system table
2) If your username IN oracle AAKASH, then here owner or shchem is aaksas in CAPITAL letters, it will show only tables belong to AAKASH oracle user.
3) there are so many properties of table, you may use * in query. NUM_ROWS is no of records in that table. And I have ordered it in descending manner by number of records
4) So when u see query result, you will find table with most no of rows, at the top.

pratik_garg commented: great explaination +2
urtrivedi 276 Nearly a Posting Virtuoso

Dear arsenalfun, MARK IT SOLVED, so that others do not trouble them.

urtrivedi 276 Nearly a Posting Virtuoso
select TABLE_NAME, NUM_ROWS from all_tables where owner='SCHEMANAME' ORDER BY num_rows DESC
urtrivedi 276 Nearly a Posting Virtuoso

I think on second verision of your code line no 13,25,26 is having un wanted paranthesis. Your effort is in right direction, but I think you need to do proper code indentation as I did below

while($row = mysql_fetch_array($result))
{
	$src = '';
	switch( $row['speed'] ) 
	{
		case 'fast':
			$src = 'fast.png';
			break;
		case 'slow':
			$src = 'slow.png';
			break;
		default:
			$src = 'default.jpg';
	}
	
	
	$ico = '';
	switch( $row['icon'] ) 
	{
		case 'icon1':
			$ico = 'icon1.png';
			break;
		case 'icon2':
			$ico = 'icon2.png';
			break;
		default:
			$ico = 'icondefault.jpg';
	}
	



	echo "<tr>";
	echo "<td><a href='http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF'])."/hits.php?id=".$row['id'] . "'>".$row['proxy']."</a></td>";
	echo "<td>" . $row['hits'] . "</td>";
	echo "<td>" . $row['age'] . "</td>";
	echo "<td>" . $row['country'] . "</td>";
	echo "<td><img src=\"". $src."\" /></td>";
	echo "<td><img src=\"". $ico."\" /></td>";
	echo "</tr>";
}
echo "</table>";


?>

Also You may write mysql case statment in your query, so that you need not to use switch statment for displaying dynamic images.

urtrivedi 276 Nearly a Posting Virtuoso
select * from invoice 
where document_no in (
                 select max(document_no) from invoice 
                 where document_date in (select max(document_date) from invoice)
                     )
urtrivedi 276 Nearly a Posting Virtuoso

set id for DIV not for FORM, as i did in following code

<form >
    <div id="he">
    <input name="regPictures1" type="file" size="12"/>
 
    <br/>
    <input type="button" id="btnAdd" value="More" onclick="newUpload();" />
    </div>
    </form>
urtrivedi 276 Nearly a Posting Virtuoso
.
.
.
<input id=barcode type=text>
.
.

in your function you can write

.
.
.
function getBarCode(ItemCode,VendCode,Cat)
{
.
.
.
.
.
.
.
   var barcodeval = Item+Mcode+Category;
   document.getElementById("barcode").value=barcodeval;
.
.
.
}
.
.
urtrivedi 276 Nearly a Posting Virtuoso

I think you are looking for this.

<?php
$firstday="Tuesday";
$secondday="Saturday";

$today=date("l");

$nextdate1=strtotime("next $firstday");
$nextdate2=strtotime("next $secondday");


if ($today==$firstday || $today==$secondday)
{
	echo "Today: ".date("m-d-Y")."<br>";
}
if ($nextdate1<$nextdate2)
{
	echo "Next: ".date("m-d-Y l",$nextdate1)."<br>";
	echo "Next: ".date("m-d-Y l",$nextdate2)."<br>";
}
else
{
 	echo "Next: ".date("m-d-Y l",$nextdate2)."<br>";
	echo "Next: ".date("m-d-Y l",$nextdate1)."<br>";
}


?>
urtrivedi 276 Nearly a Posting Virtuoso

If you want to find closest distance, you have to search for whole table in any case.

Instead of using self php loop code, I think keeping it in mysql will handle it effciently.

You need not to disable function. It uses resources only when you use it in your query.

any ways if you want to remove it permanently from mysql database then you may run following query

drop function get_poi_distance
urtrivedi 276 Nearly a Posting Virtuoso

Why not use my solution?
It guarantees no two equal randoms and doesn't require database queries.

I think user want the solution across the sessions. without database and using only php code user may end up using duplicates values.

urtrivedi 276 Nearly a Posting Virtuoso

line 62 and 63. comment line 63 and echo emilto as done below

$emailto = $db->loadResult();
//QuoteHunterHelper::dispatchEmail($emailto,$body);
echo $emailto;

See whether you are getting expecting email ids on screen or not;

urtrivedi 276 Nearly a Posting Virtuoso

Make sure you make column of your table PK or unique, so when u insert any duplicate number, query will fail.

do
{
   $no=rand(300,1000);
   $insert="insert into table(column)values ($no)";
   $query=mysql_query($insert);
   if($query)//
   {
     $found=true;
   }
   else 
   {
     $found=false;
   }
}while(!found);

Kindly check mysql syntax, My code may have syntax error;

dalip_007 commented: excellent +3
urtrivedi 276 Nearly a Posting Virtuoso

comment following 2 lines, Your url do not need post fields

// curl_setopt($ch, CURLOPT_POST, 1)or die("error1");        
// curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost);

Also you may try without encoding url

urtrivedi 276 Nearly a Posting Virtuoso

Since few days I am not able to post reply or send personal message. This is not happening always, but Happens frequently.

For e.g. following is the thread I am not able to reply from any browser, any computer.

http://www.daniweb.com/web-development/php/threads/365669/1568120#post1568120

It shows time out.

This is happening since 2 months.

Any body faced this problem.

Moderators are you there.

urtrivedi 276 Nearly a Posting Virtuoso

storing multi values in single field cell is not normalised way of storing data.
YOu must keep table with columns (eventid,user).

Another doubt
you are fetching event id using date. Now if there are two events on same date, then Which event is to be considered.

urtrivedi 276 Nearly a Posting Virtuoso

Try using parenthesis

$ch = curl_init();

urtrivedi 276 Nearly a Posting Virtuoso

Here is mysql function, open sql table in phpmyadmin, copy following to sql window, type $$ IN DELIMETER text box below.

CREATE  FUNCTION `get_poi_distance`(plong float,plat float, rowlong float, rowlat float) 
RETURNS float
BEGIN

DECLARE distance float;	


set distance :=(3958*3.1415926*sqrt((plat-rowlat)*(plat-rowlat) + cos(plat/57.29578)*cos(rowlat/57.29578)*(plong-

rowlong)*(plong-rowlong))/180);


RETURN distance ;
END$$

Now run following query in new sql tab.
I am limiting here result rows to 2, You may change it to 1.

SELECT a.*,get_poi_distance(100.295, 6.234,`long`,`lat`) distance FROM `poi` a WHERE 1
order by distance  limit 2

I am not sure how it will perform with thousands of records

urtrivedi 276 Nearly a Posting Virtuoso

this is not possible.
When your page is rendered to client browser, It will execute php code first at server side and produce html source code for browser.

When php execution is over then page is in ready state.

NOw javascript/html takes up the job.

To execute php query, you must submit a form, then exeute query in another or same php file using post/get fields.

urtrivedi 276 Nearly a Posting Virtuoso

I think you can use mysql function. If you need help kindly post details about records, your input, expected output etc

urtrivedi 276 Nearly a Posting Virtuoso

I am not sure
But please check whether this query helps you or not

I think you may create view (remove only where part below), no need of stored procedure

select a.id, a.title, a.desc, a.filterid,b.name,c.Type 
from books a
left outer join filters b on a.filterid=b.id
left outer join filters_p c on b.id=c.filterId
where c.value='123'
urtrivedi 276 Nearly a Posting Virtuoso

You may use OR operator, Kindly note the positions of paranthesis.

SELECT SUM(dist)FROM distance dd, tripleg t 
WHERE 
( (t.origin=dd.destination AND t.destination = dd.origin) or  (t.origin=d.origin AND t.destination = d.destination) )

AND t#=1;

My query may cause you problem if there are two enteries for same route, I mean
Adelaide , Melbourne, 400
Melbourne , Adelaide , 400

I hope your table do not have such duplicate values

urtrivedi 276 Nearly a Posting Virtuoso

Where is the userid in these three tables.

urtrivedi 276 Nearly a Posting Virtuoso

I think you can do 1/0 using only left outer join (creaing views) instead of using nested stored procedure.

If you could post structure of your table, then I could help you to create view for it.

urtrivedi 276 Nearly a Posting Virtuoso
<html>
<script lang='javascript'>
function addhours()
{
   var dt=document.getElementById('mydate').value.substr(0,10);
   var tme=document.getElementById('mydate').value.substr(11,8);

	arrdt= dt.split("-");
      arrtme=tme.split(":");
	newdt=new Date(arrdt[0],arrdt[1]-1,arrdt[2],arrtme[0],arrtme[1],arrtme[2]);
	alert(newdt);
      newdt.setHours(document.getElementById('myhours').value);
	alert(newdt);
//alert(dt);

//alert(tme);
}
</script>
<body>
<form id=frm name=frm>
Date: <input type=text name=mydate id=mydate value='2011-05-11 15:33:42'><br>
Add Hours: <input type=text name=myhours id=myhours value=12><br>
<input type=button onclick="addhours()">
</form>
</body>
</html>
urtrivedi 276 Nearly a Posting Virtuoso

<script lang='javascript'>
var d = new Date(2011,04,11,15,33,43); //month index starts from 0-11
d.setHours(12);
alert(d)
</script>


http://www.w3schools.com/jsref/jsref_obj_date.asp

urtrivedi 276 Nearly a Posting Virtuoso

There are so many reasons your code is not working

1) Here below you can see that there is problem in value portion of your option. You must set hid here intead of 'OPTION', what ever you write in value='' is posted to next page. Title is not sent to next page

<select name="selectmenu" id="selectmenu"> 
<option value="choose a hub">Chose a hub </option> 
<option value='option'>Los Angeles Intl</option>
<option value='option'>Heathrow</option>
<option value='option'>Kennedy Intl</option>
<option value='option'>Toronto/Pearson Intl</option>
<option value='option'>Phoenix Sky Harbor Intl</option>
<option value='option'>The Hartsfield Atlanta Intl</option>
<option value='option'>Miami Intl</option>
<option value='option'>Denver Intl</option>

2) Also you have not created gethub.php file in mypages folder
3) you have not called gethub.php from you jquerytestingapp.php file. When user select value for list box then some event say onchange is to set.

urtrivedi 276 Nearly a Posting Virtuoso

My sentence was incorrrect. I was willing to tell you that use ARIAL UNICODE MS FONT. Do not use ANY OTHER FONT.

आपको युनीकोड इस्तमाल करना चाहिऐ

urtrivedi 276 Nearly a Posting Virtuoso

Do not use any font, Unicode is best option for storing data in local languages.

urtrivedi 276 Nearly a Posting Virtuoso
select a.id, a.name,count(*) total from games a 
left outer join 
(

select favorite_game_01 id from persons
union 
select favorite_game_02 id from persons
union
select favorite_game_03 id from persons
union
select favorite_game_04 id from persons
union
select favorite_game_05 id from persons

) b on a.id=b.id

where b.id is not null
group by a.id,a.name

-- order by total desc
urtrivedi 276 Nearly a Posting Virtuoso

one option is to use jquery-ui datepicker. google for jquery-ui,

IF you want to insert in any other format in mysql then, write your insert query as follows. You may use str_to_date format

$query="insert into tablename value(col1,datecol) 
values ('{$_POST['col1']}',str_to_date('{$_POST['datecol']}','%m/%d/%Y')) ";
urtrivedi 276 Nearly a Posting Virtuoso

I think you need to change it to hid instead of name

$x=$xmlDoc->getElementsByTagName('hid');

urtrivedi 276 Nearly a Posting Virtuoso

you must post your whole code, do not post part code.