urtrivedi 276 Nearly a Posting Virtuoso

post both files here configuration.php and index.php

urtrivedi 276 Nearly a Posting Virtuoso
insert into dbname.destination_table_name (dest_col1,dest_col2,dest_col3) 
select source_col1,source_col2,source_col3 
from dbname.source_table_name 
where some_colname='some condition'
urtrivedi 276 Nearly a Posting Virtuoso

put need to put deleimiter between sql commands like semicolon or any other.

DROP PROCEDURE IF EXISTS sp_Insert_Address;

if you are runing this commands in phpmyadmin, then you can use another command terminator like @@

so you code will look like

DROP PROCEDURE IF EXISTS sp_Insert_Address @@

CREATE PROCEDURE sp_Insert_Address
(
	IN p_UserID INT(11),
	IN p_Type VARCHAR(50),
	IN p_Address VARCHAR(50),
	IN p_City VARCHAR(75),
	IN p_State VARCHAR(2),
	IN p_Zip VARCHAR(15),
	IN p_mDefault INT(1)
)
BEGIN
    INSERT INTO addresses 
	(
		UserID, 
		TYPE, 
		Address, 
		City, 
		State, 
		Zip, 
		mDefault
	) 
	VALUES 
	(
		p_UserID, 
		p_Type, 
		p_Address, 
		p_City, 
		p_State, 
		p_Zip, 
		p_mDefault
	);
END@@

NOw when you copy above code in sql window, at the bottom you will find delimiter field there you replace semicolon (;) with double at sign (@@), and then execute statment

urtrivedi 276 Nearly a Posting Virtuoso

line number 69 in process_form2.php

$header = "From: $name \n";

I think they will not allow any name. you must write some email id that you have registered with them.

so you code must look like

$header = "From: registered_with_bluehost@domain.com \n";
urtrivedi 276 Nearly a Posting Virtuoso

in your grid view if there is data type property then change it to varchar

urtrivedi 276 Nearly a Posting Virtuoso

if you have written sql query somewhere than format date or time to text, so when you datatype is text it will not append anything like :00.

urtrivedi 276 Nearly a Posting Virtuoso
<?php
$str = "    Hello world hello World this is      hello world    ";
$arr=str_word_count(strtoupper($str),1);
echo "<pre>";
foreach($arr as $value)
{
	$finalarr[$value]++;
}
echo print_r($finalarr);
echo "</pre>";
?>
urtrivedi 276 Nearly a Posting Virtuoso

I will suggest you unaurthodox method if student id is not important for you.

I assume that student id is autonumber

1) first notice the maximum student id in your table. Here I assume it is 19
2) now insert distinct name in same table from same table using following query

insert into student_table (firstname,lastname) select distinct firstname, lastname from student_table

3) now delete all student id which is having studid less than or equal to 19

delete from student_table where studid<=19

I have one question. Is it not possible that 2 or more student may have same fisrtname, lastname?

urtrivedi 276 Nearly a Posting Virtuoso

are u able to work with mysql usin phpmyadmin, there i think you can look into privileges, where you can specify which host,user can connect and what he can access.

urtrivedi 276 Nearly a Posting Virtuoso

Or use the links at the bottom of the web browser for new posts in forums you're interested in.

That link is fine, but I was looking for posts that are last replied by thread starter and which are still unsolved (even if i have replied in it or not).

It means somebody is waiting for someone to reply.

thanks
UPendra

urtrivedi 276 Nearly a Posting Virtuoso

Just initialize, otherwise php may give you warning.

urtrivedi 276 Nearly a Posting Virtuoso

on second page i could give you following query for

<?php
if ($category=='id of pizza')

   $query=" select menu_title, max(if(description like '%9"%',price,null)) Nine_Inch
    , max(if(description like '%10"%',price,null)) ten_Inch
    , max(if(description like '%12"%',price,null)) twelve_Inch
    , max(if(description like '%14"%',price,null)) fourteen_Inch
    from tablename
    where category='$category'
    group by menu_title a"

else //normal query
    $query="     select menu_title, description ,price
    from tablename
    where category='$category'"
?>

I would not recommend such hard coding, this is just for your learning how to convert rows to columns
first try in phpmyadmin then integrate in php page

urtrivedi 276 Nearly a Posting Virtuoso

add second and third line shown below at line number 14

show_user_info($username);
$conn=mysql_connect("localhost","username","password");
mysql_select_db("dbname",$conn);

$q1="select timestamp from users where username='$username'";
$r1=mysql_query($q1);
urtrivedi 276 Nearly a Posting Virtuoso

not need to change query, just way of passing parameter is to be changed. Check manual of function before changing any code

mysqli_select(link,query)
mysql_select(query,link)
urtrivedi 276 Nearly a Posting Virtuoso

Do not create tables for categories. 2 is enough

Do you have actually 76 kind of pizzas with distinct type and price? if yes then i think you can not compact it anymore.

One complex design I can suggest, it is self referencing (though it may not solve your problem) this design if for to many sub categories.

it has only 2 table say menu_master (both category and item in same table AND TREE LEVEL IN SECOND TABLE) .

(menu_id, menu_desc, paraent_id, is_group, price)
0 , MAIN MENU, -1, Y, 0.00
1, PIZZA, 0 , Y, 0.00
2, PIZZA1, Y, 0.00
3, PIZZA1-1, 2, N,50.00
4, PIZZA1-2, 2, N,75.00
5, kebabs, 0,Y, 0.00
6, KEBAB1,5,N,20.00
7, KEBAB2,5,N,30.00
8, burgers, 0, Y, 0.00 
9, burger1, 8, N, 15.00

Here you can see that pizza has one more subgroup
Also groups is having is_group flag =y and price =0
actual item is having is_group flag =n and not zero price

For better reporing you may keep one more table to track levels

item_id, parent_id, level
1, 0, 1
2, 1, 1
2, 0, 2
3, 2, 1
3, 1, 2
3, 0, 3
4, 2, 1
4, 1, 2
4, 0, 3
5, 0, 1
6, 5, 1
6, 0, 2
7, 5, 1
7, 0, 2
8, 0, 1
9, 8, 1
9, 0, 2

When you create make sure that item is not created under item, only groups could be treated as parent


I have succesfully get rid of sub-sub-sub categories with above design

urtrivedi 276 Nearly a Posting Virtuoso

I think parameter place in mysql and mysqli is interchanged. so you need to modify everywhere only adding 'i' is not sufficient.

urtrivedi 276 Nearly a Posting Virtuoso
$result = mysql_query( "SELECT page_name FROM ms_content" )
	or die(mysql_error()); 
$num_rows = mysql_num_rows($result);
$mainmenu="";
while ($get_info = mysql_fetch_row($result))
{	
        $mainmenu .= ".:";	
        $mainmenu .= $get_info[0];
        $mainmenu .= "</br>";
}
urtrivedi 276 Nearly a Posting Virtuoso

while inserting you can do like

INSERT INTO `data` (`test`, `test1`, `test2`, `total`) VALUES(20, 20, 20, 20+20+20);

after inserting you must run update query like

update data set total=test+test1+test2 where total=0
urtrivedi 276 Nearly a Posting Virtuoso

For learning basic queries, microsoft access is good software.
There you can drag columns and apply functions, and you can see sql query generating on its own.

urtrivedi 276 Nearly a Posting Virtuoso

what you have given is your requirement, but how you want it to work,
1) do you want single php form where you enter age and census year and you get period of year of born
2) or you have some large data in excel, csv and you want to add one more column to that table

urtrivedi 276 Nearly a Posting Virtuoso

post your code here

urtrivedi 276 Nearly a Posting Virtuoso

add one more closing ) before { at line 41

if(!empty($_POST['pass1']) ) {
urtrivedi 276 Nearly a Posting Virtuoso

you can also search help on mssql_field_name() in your case it could be sqlsrv_field_name()

urtrivedi 276 Nearly a Posting Virtuoso

I think when you connect in java, you must always run this two query before doing anything, because change is applicable to session only. TO CHANGE IT PERMANANTELY YOU MUST HAVE SYSTEM USER ACCSESS

urtrivedi 276 Nearly a Posting Virtuoso

before executing query you echo it for example. copy that query result from browser and run in phpmyadmin, is it running there

$query="update ir312 SET R3_21 = $tot WHERE irdnumber=$irdnumber ";
echo $query;
mysql_query($query)

several reason for query failure.
1) On linux mysql table name are case sensitive
2) have you selected proper database before executing query

urtrivedi 276 Nearly a Posting Virtuoso

dear driftingsteps
If you your code is in pure html then you may not save your code from being stolen. But now a days I do not think any website in pure html.
So I guess you have developed your site in php-mysql or any other such language. If you deploy site on your dummy server and if user view source of copy it, then they could now see php source. So your work is safe.


Disabling right click is possible but I m not sure it will stop user from viewing source, because there are so many options to view source. Success of this script depends on browser settings.

You must write following line in all pages where you want to disable right click. I assue you copy offrightclick.js (attached) in js_script folder which is one level up your source.

<script src="../js_script/offrightclick.js" language="JavaScript"></script>
urtrivedi 276 Nearly a Posting Virtuoso

Dear moderator,
We do have so many thread tabs like
all thread
new stories
product reviews
code snippets
tutorial
upvoted
solved
unanswered

I always felt one more in the list is required. Like if user who started thread was last to reply on that thread and that thread is still unsolved. It means that user is expecting someone to answer.

If such threads are shown separtely in another tab, then I feel that it could help someone in better manner and in short period of time.

Regards
Upendra

urtrivedi 276 Nearly a Posting Virtuoso

at the end of page load write following js code

<script lang='javascript'>
checkCheckBoxes();
</script>
urtrivedi 276 Nearly a Posting Virtuoso

post complete code, and let me know when logic fails (what you input and what not)

urtrivedi 276 Nearly a Posting Virtuoso

function is running fine here

I think you have problem with

<input type="checkbox" name="chk1"  onclick='checkCheckBoxes()' />check for Birth year only

or if you have chrome, then open tool> java script console, there you will able to see error.

urtrivedi 276 Nearly a Posting Virtuoso

I am not sure about the command, but you may have noticed this line in that link

Your client tool may be overriding your carefully set NLS Parameters. For example, in SQL Developer and JDeveloper (Tools -> Preferences… -> Database -> NLS Parameters)

Check the database parameters:

select * from nls_session_parameters;

This could also help

ALTER session SET NLS_COMP=LINGUISTIC 
ALTER session SET NLS_SORT=BINARY_AI
urtrivedi 276 Nearly a Posting Virtuoso

How mysql server will know what to select out of multiple choices,
1134
1125

What is criteria of selection. what is the version of mssql

urtrivedi 276 Nearly a Posting Virtuoso

I used to convert things in upper case while comparing strings in oracle

select * from test where upper(ID_PRIVILEGES) = upper('Admin');

You may also follow this link
http://geekzspot.blogspot.com/2010/01/case-insensitive-oracle-database.html

urtrivedi 276 Nearly a Posting Virtuoso

I am not sure it is the best way or not, what you can do is create view

create view  myview as SELECT col1, col2, col3, ROW_NUMBER() OVER (ORDER BY col1) myrow_srno FROM tablename
-- or 
create view  myview as SELECT rownum myrow_srno,col1, col2, col3 FROM tablename

then you may select things in your query as I shown you yesterday

SELECT col1,col2,col3 FROM 
   MYVIEW 
   WHERE myrwo_srno BETWEEN 51 AND 100

I think view will follow best execution plan

urtrivedi 276 Nearly a Posting Virtuoso
<html>
<head>
<script lang='javascript'>


function setcode()
{
// alert( );
   document.form1.code.value = document.form1.list1.value+'-'+document.form1.list2.value+'-'+(document.form1.list2.selectedIndex+1);
}
</script>
</head>
<body>


<form action="" method="get" name="form1" >

<select name="list1" onchange=setcode()>
<option value="MUM">MUM</option>
<option value="DEL">DEL</option>
<option value="BAN">KOL</option>
<option value="HYD">HYD</option>
</select>
<select name="list2"  onchange=setcode()>
<option value="MUM">MUM</option>
<option value="DEL">DEL</option>
<option value="BAN">KOL</option>
<option value="HYD">HYD</option>
</select>
<input name="code" type="text" />
</form>
</body>
<script lang='javascript'>
setcode();
</script>
</html>
urtrivedi 276 Nearly a Posting Virtuoso

You question is not clear,

If you do not want name to change in update, then you may ignore writing column name in update query.

insert="insert into table (col1, col2, col3,filename) values ('1','2','3','myfile')";

update="update  table set col2='2', col3='3' where col1='1'";
urtrivedi 276 Nearly a Posting Virtuoso

where is checkcode() source code? Post complete code and what exact problem your facing?

How would somebody know, that what is not working in your case?

urtrivedi 276 Nearly a Posting Virtuoso
SELECT col1,col2,col3 FROM 
   (SELECT col1, col2, col3, ROW_NUMBER() OVER (ORDER BY col1) myrow_srno FROM tablename)
   WHERE myrwo_srno BETWEEN 51 and 100;
debasisdas commented: agree +13
urtrivedi 276 Nearly a Posting Virtuoso

What do u mean by autoreconnect?

urtrivedi 276 Nearly a Posting Virtuoso

make only two changes as shown below

<?php
.
.
.
.
while ($row = mysql_fetch_assoc($extract) || $totala<10)
{

$totala++;
.
.
.
.

?>
urtrivedi 276 Nearly a Posting Virtuoso
urtrivedi 276 Nearly a Posting Virtuoso

you may try

wardrobe.php?key=hash&value=HASHTAG
or
wardrobe.php?key=friend&value=FRIENDNAME

your code file may look like

<?

header("Content-Type: image/png");

$value = strtolower($_GET['value']);

if( strtolower($_GET['value'])=='hash')
   $filepath = "wardrobe/$value";

else if( strtolower($_GET['value'])=='friend')
   $filepath = "wardrobe/md5($value)";
else
   exit;

$errorpath = "wardrobe/cb5e100e5a9a3e7f6d1fd97512215282";

if (is_readable($filepath)) {
	readfile($filepath);
} else {
	readfile($errorpath);
}	




?>
urtrivedi 276 Nearly a Posting Virtuoso

using return statement at the end of function

function Email()
	{
		
		$the_name = $_SESSION[$this->GetLoginSessionVar()];
	
		$profil_query="SELECT * FROM $this->tablename WHERE username='$the_name'";

		$resultate_profil=mysql_query($profil_query);

		$resultat=mysql_fetch_array($resultate_profil);
		
		$mail = $resultat['email'];
	 
                return $mail;
	}
$revalue=Email();
echo $retvalue;
karthik_ppts commented: useful +4
urtrivedi 276 Nearly a Posting Virtuoso
<html>
<head>
<script lang='javascript'>
var isNumeric  = /^(\d*)(\.?)(\d*)$/;

function checknum()
{
     if (!isNumeric.test(document.frm.txt1.value))
     {
	 alert( 'Not a valid number');
	 return false;
     }
     else
     {
        alert( 'Number Accepted');
	return false;
     }
}
</script>
</head>
<body>
<form name=frm id=frm action='#' method=post>
<input type=text name=txt1 id=txt1>
<input type=button name=btn1 id=btn1 value=check onclick='javascript:checknum()'>
</form>
</body>
</html>
urtrivedi 276 Nearly a Posting Virtuoso

In your b.asp code you may write

<%
dim txt1
txt1=Request.Form("txt1")
If txt1<>"" Then
      Response.Write("txt1=" & txt1)
End If
If Request.Form("txt1")<>"" Then
      Response.Write("txt2=" & Request.Form("txt1"))
End If

If Request.Form("myfield")<>"" Then
      Response.Write("myfield=" & Request.Form("myfield"))
End If
%>
urtrivedi 276 Nearly a Posting Virtuoso

When you are not using code posted by me then how you can expect result. use following query

select  
                    a.id as 'id', 
                    a.adjust as 'adjust', 
                    a.counter as 'counterCode',  
                    c.name as 'counterName', 
                    a.clientName as 'clientName', 
                    a.loginId as 'loginId', 
                    a.exchRate as 'exchRate', 
                    a.filledQty as 'filledQty', 
                    a.ordStatus as 'ordStatus', 
                    a.price as 'price', 
                    a.quantity as 'quantity', 
                    a.remark as 'remark', 
                    a.settCurr as 'settCurr', 
                    tradCurr=isNull(c.currency, b.currency),  
                    a.traderCode as 'traderCode', 
                    a.tradingAccNo as 'tradingAccNo', 
                    a.transType as 'transType', 
                    a.createdDate as 'createdDate',
                    b.id as 'exchId', 
                    b.name as 'exchCode' 
                    from rm_markettransaction a 
                    left join RM_Exchange b 
                    on a.rm_exchange_fk = b.id 
                    left join RM_Counter c 
                    on c.code = a.counter 
                    where b.srcType='offline' and CONVERT(VARCHAR(10), a.createdDate, 120) = '2011-06-10'
urtrivedi 276 Nearly a Posting Virtuoso
SELECT CONVERT(VARCHAR(10), GETDATE(), 120) AS [YYYY-MM-DD]

For details refer following link
http://www.sql-server-helper.com/tips/date-formats.aspx

urtrivedi 276 Nearly a Posting Virtuoso

In page a.asp you can keep one hidden form element, that will be passed to b.asp on submitting form. IN setvalue fuction you can set value for that field before submitting the form.

<script lang='javascript'>
function setvalue()
{
     document.getElementById('myfield ').value='newvalue';
     document.frm.submit();
}
</script>
<form name=frm action=b.asp method=post>
<input type=text name=txt1>
<input type=text name=txt2>
<input type=hidden name=myfield id=myfield value='somevalue'>
<input type=button name=txt1 onclick='javascript:setvalue()'>
</form>
urtrivedi 276 Nearly a Posting Virtuoso

you can not append child to firstdrop its not container, you may append it to form element

urtrivedi 276 Nearly a Posting Virtuoso

download indian language editor vishalon.net