urtrivedi 276 Nearly a Posting Virtuoso

I used 2 tables for solving this problem in past. Table pair gives unlimited categories or not categories at all. This is same as directory structure in your computer.
1) product_master (prod_id, prod_name, is_group, other_columns)
2) product_level (child_prod_id, parent_prod_id, level_no)

product_master
prod_id, prod_name, is_group, other_columns
0, Items, Y, XYZ (This is root group)
1, Pen, Y, xyz1 (This is sub group)
2, Black pen, N, PQR (This is first item of first group)
3, Red Pen, N, QBC (This is second item of first group)
4, HB Pencil, N, NCR (This is direct item under primary "Items" group)

Product_level (This is to keep track of categories and items properly)
child_prod_id, parent_prod_id, level_no
0,0,0 (root under self at level 0)
1,1,0 (first group under itself at level 0)
1,0,1 (first gropu under items at level 1
2,2,0 (first item under itself at level 0)
2,1,1 (first item under first gropu at level 1)
2,0,2 (first item under "items" at level 2)
3,3,0 (second item under itself at level 0)
3,1,1 (second item under first gropu at level 1)
3,0,2 (second item under "items" at level 2)
4,4,0 (third item under "items" at level 2)
4,0,1 (third item under "items" at level 1)

urtrivedi 276 Nearly a Posting Virtuoso

First time you set CURLOPT_COOKIEJAR, for rest of all calls, use same name with option CURLOPT_COOKIEFILE.

<?php
$cookie=tempnam("/tmp","CURLCOOKIE");
$agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7";
;

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $login);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_REFERER, $login);
$html=curl_exec($ch);

$ch = curl_init();
$nexturl=http://www.url.com/q.action?id=A555400D38C7F737D383DEEBA8A30CE3.GT.1"
curl_setopt($ch, CURLOPT_URL, $nexturl);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_REFERER, $nexturl;
$html=curl_exec($ch);




?>
urtrivedi 276 Nearly a Posting Virtuoso

I assume that ur string have only one colon, and next to colon is the text u need to find

$fullstr="   5 gallon qty: 10";
$strarr=explode(":",$fullstr)
echo "qty=".trim($strarr(1));
urtrivedi 276 Nearly a Posting Virtuoso

phpmyadmin version has nothing to do with mysql command syntax, mysql version is important.
What sql you writing and what error are u getting.

urtrivedi 276 Nearly a Posting Virtuoso

try to join with userid insteaad username

on CustomerCode = aspnet_Users.UserId

select aspnet_Membership.UserId,IsLockedOut,UserName,tableCustomer.CustomerName,tableCustomer.CustomerContactName
 from dbo.aspnet_Membership
 left join dbo.aspnet_Users on aspnet_Users.UserId = aspnet_Membership.UserId
 left join dbo.tableCustomer on CustomerCode = aspnet_Users.UserId
  where IsLockedOut = 1
urtrivedi 276 Nearly a Posting Virtuoso

right now what problem you face?
Post your table struture and sample data here

urtrivedi 276 Nearly a Posting Virtuoso

what is your datatype of startime, endtime, i guess it of type date and not varchar

if its date type, then you need not to use to_date

simply starttime>'14-feb-2012 01:00:00 am' will work

urtrivedi 276 Nearly a Posting Virtuoso
.
.
.
.
if(checkEmail($dbemail))
{
    $resultsbla = $DBH->prepare("insert INTO lime_tokens_262697 (firstname, lastname, email, attribute_1, emailstatus) VALUES ('$dbemail', '$dbemail', '$dbemail', '$dbunikid', 'OK')");
    $resultsbla->execute();
 }
 .
 .
 .
urtrivedi 276 Nearly a Posting Virtuoso
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;
}

 $dbemail="abc.com";
 if(checkEmail($dbemail))
 {
    echo "ok";
 }
 else
 {
   echo "invalid email";
 }
urtrivedi 276 Nearly a Posting Virtuoso

In my view, if possible status list is not going to change ever, then you can use enum type

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

I changed you line number 8 in your code and I added last line in ur orderconfirm function

    $cart = $_SESSION['cart'];
    $items = explode(',',$cart);
    $result = count($items);
    $total_list='';
    for ($i=0; $i<$result; $i++)
    {
        //echo $items[$i];
        $total_list=$total_list."<br>".orderconfirm($items[$i]); //URTRIVEDI MODIFIED THIS LINE
    }

    function orderconfirm($productid)
    {
        $cus_id = $_SESSION['own_email'];
        $pro_id = $productid;
        $result = mysql_query("SELECT * FROM products where id = '$pro_id'");
        if($row = mysql_fetch_array($result))
        {
        $subject = $row['Subjects'];
        $main_proname = $row['mainproduct']; 
        $proname = $row['p_name'];  
        $prodetail = $row['details'];   
        $proprince = $row['prince'];
        }
        $holder = $_POST['holder'];
        $bank = $_POST['bank'];
        $branch = $_POST['branch'];
        $ac_no = $_POST['ac_no'];
        $cheqdate = $_POST['cheqdate'];
        $cheq_no = $_POST['cheq_no'];
        $total_amount = $_POST['tota_amount'];

        $total_list = $proname.'-'.$main_proname.'-'.$proprince.'<br />';

    /*  $qry = "INSERT INTO `sales_data`(`cust_id` , `subject` , `pro_id` , `mainproduct` , `pro_name` , `prince` , `bank` , `cheque_no` , `holder_name` , `branch` , `ac_no` , `cheqdate` , `paid` )
         VALUES ('$cus_id', '$subject', '$pro_id', '$main_proname', '$proname', '$proprince', '$bank', '$cheq_no', '$holder', '$branch', '$ac_no', '$cheqdate', 'no')";

        echo $qry; 



        $coloer1 = '';
        if (!mysql_query($qry))
          {
          die('Error: ' . mysql_error());
          } */
        return $total_list; //URTRIVEDI ADDED THIS LINE
    }
    echo $total_list;


    //unset($_SESSION['cart']);
    //$_SESSION['cart']=='';
    //echo "1 record added";
    //header("Location: thankyou.php");
        //exit();
    ?>
urtrivedi 276 Nearly a Posting Virtuoso

are u sure u going to put some $row value in this javascript?, if not, then just keep this script out of php, becasue if u keep it in loop, the script will generate number of times the records are in ur query.

or use something like,
title="<?php echo $row['somevalue']; ?>";

urtrivedi 276 Nearly a Posting Virtuoso

i dont find error in ur code, its compiles well

urtrivedi 276 Nearly a Posting Virtuoso

just need whole code otherwsie cant find error

urtrivedi 276 Nearly a Posting Virtuoso

I think its simple 2D array

$arr[0]['name']=Bob;
$arr[0]['last']=Jones;
$arr[0]['age']=36;
$arr[1]['name']=James;
$arr[1]['last']=Brown;
$arr[1]['age']=29;
$arr[2]['name']=Lloyd;
$arr[2]['last']=Mals;
$arr[2]['age']=45;

echo $arr[1]['name'];
urtrivedi 276 Nearly a Posting Virtuoso

post complete code, $row is not used anywhere in your code,
so better you write php code where needed,
dont include all static html code in php echo.

urtrivedi 276 Nearly a Posting Virtuoso

post ur both code files

urtrivedi 276 Nearly a Posting Virtuoso

abzy, you saying so many times in your post that you dont understand basket ball, before designing ERD you need to learn all things (rules,scoring method,people involved) about basketball, otherwise your ERD will surely go wrong, if you build it on scattered tips received here.

urtrivedi 276 Nearly a Posting Virtuoso

when page reloads, everything in javascript resets, So I advised you to store last number in cookie and increment and display that cookie value on every page load

http://www.w3schools.com/js/js_cookies.asp

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

I just looked at your latest post thought thats whats you are working on.

But your original query is fine, you just enquote your e-mail (as you are using hyphen in col name) column with ` (back quote, first key in keyboard, above tab)

$q = mysql_query("INSERT INTO kontakte (`emri`, `mbiemri`,`e-mail`,`nr`, `adresa`, `shenime`) VALUES('{$_POST['emri']}','{$_POST['mbiemri']}','{$_POST['email']}','{$_POST['nr']}','{$_POST['adresa']}','{$_POST['shenime']}')");
urtrivedi 276 Nearly a Posting Virtuoso

I have lines changed 5 to 15 in above code, you can not write if in string formation.
remove all your 5 - 15 lines and only add following line.

$q = mysql_query("INSERT INTO kontakte (emri, mbiemri,e-mail,nr,adresa,shenime) VALUES('{$_POST['emri']}','{$_POST['mbiemri']}','{$_POST['email']}','{$_POST['nr']}','{$_POST['adresa']}','{$_POST['shenime']}')");
urtrivedi 276 Nearly a Posting Virtuoso
    $result = mysql_query(mysql_query("SELECT COUNT(`user_id`) FROM `users` WHERE `username` = '$username' AND `recover_password` = '$recover_password'");

    $row = mysql_fetch_array($result));

    if($row[0]==1)
       $flag=true;
    else
       $flag=false;
urtrivedi 276 Nearly a Posting Virtuoso

I would like to say that there is some misunderstanding.
You can not run php code under javascript (line 4 in above your code (your last post) will not work.

1) One basic thing you must understand that, php runs at server and javascript runs at clients browser

2) When page is loading in user's browser, php is executed at server, before user can see or do any action on that page. (not at client browser) (just view page source and see your function in javascript how it looks, do u find any php code there)

3) after getting confirmation using javascript, you must use javascript to submit your form
a) form may have hidden key value to delete
b) form action may be a php page which handles delete request
c) php page will delete that record and prints output in client browser, that record is deleted now.

mainpage.php

<script language="javascript">
function delform()
{
  if(confirm("Are you sure you want to delete"))
  {
      document.myform.submit();
  }
  else
  {
      return false;
  }
}
</script> 


<form action="delete.php" method="post" name="myform" id="myform" >
<input name="delid" id="delid" type="hidden" value="53" size="30" />
<input name="btnsubmit" id="btnsubmit" onClick="delform()" value="Delete record 53" type="button"> 
</form>

delete.php page

<?php
$con=mysql_connect("localhost","root");
mysql_select_db("dbfirest",$con);

$s=$_POST['delid'];

$sql="delete from tblfireincidents where fire_id='".$s."'";
$result=mysql_query($sql);

if($result)
   echo "Record $s deleted successfully";
else
   echo "Error occured while deleting Record $s";

?>
urtrivedi 276 Nearly a Posting Virtuoso

You way is not proper to achieve your aim.

Use any of the following 2 ways

Way 1

<?php
$bd=array('1'=>'420','2'=>'520'); 
echo $bd[1]."<br>"; 
echo $bd[2]; 

?>

Way 2

<?php
$bd[1]=420;
$bd[2]=520;

echo $bd[1]."<br>";  
echo $bd[2]; 

?>
urtrivedi 276 Nearly a Posting Virtuoso

In my view deleting record can not be done buy pure html.

If you embed php code in javascript, that code will execute at the time of page loading and not when buttton is clicked.

simple javascript can not tell server to delete record (unless you use ajax).

And for taking confirmation, you must use confirm() function rather alert

if(confirm("Are you sure you want to delete"))
{
    document.form.submit();
}
else
{
    return false;
}
urtrivedi 276 Nearly a Posting Virtuoso

Try with double quotes, use statement given below, Php string is in double quote and html element values are in single quote

echo("<embed src='flash/" . rand(1, 5) . ".swf' type='application/x-shockwave-flash' width='320' height='240'></embed>");
urtrivedi 276 Nearly a Posting Virtuoso

We need to look at your code to find the problem. Only statement can not help.

urtrivedi 276 Nearly a Posting Virtuoso

whts ur need? what columsn u need?

urtrivedi 276 Nearly a Posting Virtuoso

in first 2 line / before javascript missing

urtrivedi 276 Nearly a Posting Virtuoso

are u working on ur computer or script is somewhere on live server?
You need to check spellings of all js file u include, are they in /javascripts folder or not

urtrivedi 276 Nearly a Posting Virtuoso

<a href='http://yoursite/yourpdffolder/pdffile1.pdf'>My first pdf</a>
<a href='http://yoursite/yourpdffolder/pdffile2.pdf'>My second pdf</a>

If clients browser has appropriate pdf reader, it will open it on click in same window, otherwise ask user to save it.

you can generate above code dynaimcally using dir php function

urtrivedi 276 Nearly a Posting Virtuoso

can you put sample data from table a and b

urtrivedi 276 Nearly a Posting Virtuoso

I think its depend on how you use php or any other application to pass information to mysql server.
In phpmyadmin when i pasted नमस्कार, it is stored well in same way (i m using utf8* collation)

Also if you store codes in mysql, that also can be represented in language word on browser very well.

So just check your database updating pages, how they behaving.

urtrivedi 276 Nearly a Posting Virtuoso

I use md5 in both mysql and php

for oracle following link may help
http://www.oracle-base.com/articles/9i/storing-passwords-in-the-database-9i.php

urtrivedi 276 Nearly a Posting Virtuoso

try storing collation as utf8_general_ci for the varchar/text column, then normal update insert will save it in unicode

urtrivedi 276 Nearly a Posting Virtuoso

select * from table
where DESCRIPTION LIKE "%searchterm1%" or
DESCRIPTION LIKE "%searchterm2%" or
DESCRIPTION LIKE "%searchterm3%" or
DESCRIPTION LIKE "%searchterm4%"

urtrivedi 276 Nearly a Posting Virtuoso

Lastmitch I think above query will work on mysql

Nagarjun you can use MERGE query to update table from another table in oracle

merge destination_table d using source_table s on (d.key1=s.key1 and d.key2=s.key2)
when matched then update set d.colx=s.coly

LastMitch commented: Nice Answer! I learn something from you! +0
urtrivedi 276 Nearly a Posting Virtuoso

Here is the code

<html>
<script lang='javascript'>
function fraclength(num)
{
    alert(num.split(".")[1].length) ;

}

fraclength("54.93934");

</script>
</html>
urtrivedi 276 Nearly a Posting Virtuoso

the souce is wat responsible of what u see on browser, you can not hide it from user, dont waste time in that
make server side script stronger and secure

urtrivedi 276 Nearly a Posting Virtuoso

add semicolon to end of all statments for eg in line 4, 5

or post full code

urtrivedi 276 Nearly a Posting Virtuoso
select * from users where id not in (select userIdRec from quiz)
urtrivedi 276 Nearly a Posting Virtuoso

I think on your server created date is 000000.

urtrivedi 276 Nearly a Posting Virtuoso

AND must follow boOlean result. you are giving subquery to AND

tell us :
table strutrute
sample data
sample expected output

urtrivedi 276 Nearly a Posting Virtuoso
select username, bid from tablename a inner join 
(
     select min(b.bid) minbid from (select bid,count(*) cnt from tablename group by bid having     count(*)=1 )b 
) c on a.bid=c.minbid
urtrivedi 276 Nearly a Posting Virtuoso

where bid value is stored, what is ur table structure

urtrivedi 276 Nearly a Posting Virtuoso