User Profile

Collapse

Profile Sidebar

Collapse
semanticnotion
semanticnotion
Last Activity: Apr 20 '11, 06:33 AM
Joined: Sep 23 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • semanticnotion
    started a topic How to compare two mysql tables in php
    in PHP

    How to compare two mysql tables in php

    i have a movie table and i want to compare the common movies of two users.

    Code:
    $array1=array();
    $array2=array();
    $query2="select name from movie where user_id='1'";
    $result2=mysql_query($query2) or die(mysql_error());
    while($rss = mysql_fetch_assoc ($result2))
    {
        $array1[]=$rss;
    }
    print_r($array1);
    This will print
    Code:
    Array ( [0] => Array ( [name]
    ...
    See more | Go to post

  • how to compare two arrays and find the count of match elements

    Hello all, i have two arrays i.e
    Code:
    $ar1=array("Mobile","shop","software","hardware");
    and
    Code:
    $arr2=arry("shop","Mobile","shop","software","shop")
    i want to compare the elements of arr2 to arr1 i.e
    Code:
    foreach($arr2 as $val)
        { 
            if(in_array($val, $arr1))
            {    
                //mycode to insert data
    ...
    See more | Go to post

  • semanticnotion
    started a topic How to integrate my website to facebook?
    in PHP

    How to integrate my website to facebook?

    I want to integrate my site to Facebook login system. I google it and at last I find this great tutorial.http://thinkdiff.net/facebook/php-sd...nect-tutorial/

    But there is a problem in my authentication. Herehttp://www.cpantry.com/match you can find my test site. I have used php-sdk please help where I make a mistake.
    here is code of my index.php
    Code:
    <?php
        include_once "fbmain.php";
    ...
    See more | Go to post

  • semanticnotion
    started a topic update data using jquery

    update data using jquery

    I have a page that lists records from a database call. I want to have an 'edit' link on each row that will popup a Jquery dialog so that the row can be edited. My question is how do I pass the data from the selected row to the jquery dialog box so that it can be edited?
    i have the code which open jquery popup but the textboxes are empty.

    Code:
    <div id="boxes">
    
    <div id="dialog2" class="window">
    ...
    See more | Go to post

  • i read the manual about json_encode() but could't get the clue how to extract data from two or more tables.
    See more | Go to post

    Leave a comment:


  • if does't fulfill my requirements
    ok let me confirm whats wrong with this code

    Code:
    $table_first = 'recipe';
    $query = "SELECT * FROM $table_first";
    $resouter = mysql_query($query, $conn);
    
    
    $set=array();
    while ($link = mysql_fetch_array($resouter, MYSQL_ASSOC)){
    foreach ($link as $fieldname => $fieldvalue){
        $set[]= $fieldvalue;}
     $query2="SELECT ingredients.ingredient_id,ingredients.ingredient_name,ingredients.ammount
    ...
    See more | Go to post

    Leave a comment:


  • my table structure is

    recipe{rec_id,n ame,overview,ca tegory,time,ima ge}
    ingredients{ing redient_id,ingr edient_name,amm ount,rec_id}
    instructions{in struction_id,in struction_text, rec_id}

    look at rec_id which is foreign key in both tables.

    so queries should be
    Code:
    $query1="select * from recipe";
    than it should iterate in table2 against the relevant id from table1;
    ...
    See more | Go to post

    Leave a comment:


  • How to extract data from mysql in json using php?

    hi i have 3 tables in mysql i retrieved the data in xml using php now i want to retrieved the same data in json format but i have some problem in queries.
    i retrieved data from one table in json but unable to retrieved from three tables any help would be appreciated my code for one table is.
    Code:
    $table_first = 'abc';
    $query = "SELECT * FROM $table_first";
    $resouter = mysql_query($query, $conn);
    
    $set
    ...
    See more | Go to post

  • the join query returns all the data at once what i want to do is that to retrieved the relevant records. i.e for id 1 of first table there are 5 relevant records in second table and 3 records relevant to this in third table.
    i want to print the id 1 of table one than all the relevant records of table 2 and table 3.
    And same for id 2 of table 1......
    See more | Go to post

    Leave a comment:


  • How to extract mysql data into json using php?

    i have retrieved mysql data from one table in json using the following script

    Code:
    $table_first = 'abc';
    $query = "SELECT * FROM $table_first";
    $resouter = mysql_query($query, $conn);
    
    $set = array();
    
    $total_records = mysql_numrows($resouter);
    if($total_records >= 1){
    
      while ($link = mysql_fetch_array($resouter, MYSQL_ASSOC)){
        $set[] = $link;
    ...
    See more | Go to post

  • semanticnotion
    started a topic php error_reporting(E_ALL) problem
    in PHP

    php error_reporting(E_ALL) problem

    i put error_reporting (E_ALL) on top of my instruction page to know about the expected errors. the whole page now work fine for me and i removed
    Code:
    error_reporting(E_ALL)
    from my code but still it gives me the following notice.
    Code:
    Notice: Undefined index: action in /var/www/vhosts/semanticnotion.com/httpdocs/cafe/view/instructions.php on line 5
    what should i do to remove this notice.

    on instructions page
    Code:
    <form method="post"
    ...
    See more | Go to post

  • semanticnotion
    replied to How to parse nested xml into php?
    in PHP
    which one is best SOAP or XML-RPC
    and would you like to share some useful tutorial about the best one cause i have no idea.
    See more | Go to post

    Leave a comment:


  • semanticnotion
    replied to How to parse nested xml into php?
    in PHP
    Thanks Dormilich for your reply now i solved the thread read the .xml successfully in php file but now my question is how can i read the client request(web service request) and update the data accordingly in php file.
    See more | Go to post

    Leave a comment:


  • semanticnotion
    started a topic How to parse nested xml into php?
    in PHP

    How to parse nested xml into php?

    Hi all i have an xml file e.g
    Code:
    <recipe>
    <id>abc</id>
    <name>abc</name>
    <instructions>
    <instruction>
    <id>abc</id>
    <text>abc</text>
    </instruction>
    <instruction>
    <id>abc2</id>
    <text>abc2<text>
    <instruction>
    <instructions>
    <recipe>
    ...
    See more | Go to post

  • what should be best approach for this
    See more | Go to post

    Leave a comment:


  • Code:
    $input = file_get_contents("recipe_xml.php");
    
    $xml = new SimpleXMLElement($input);
    
    
    $recipe=$xml.recipe;
    $rec_id=$xml.rec_id;
    
    echo $recipe;
    echo $rec_id;
    i do this but this gives the following error...

    Code:
    Warning: SimpleXMLElement::__construct(): Entity: line 100: parser error : Start tag expected, '<' not found in /var/www/cafe/view/update_xml.php
    ...
    See more | Go to post

    Leave a comment:


  • semanticnotion
    started a topic How to call xml from php file to another file
    in PHP

    How to call xml from php file to another file

    hi i have php file that reads the data from three table of mysql in xml now i want to call the xml data on this page into another page.
    how should i do this
    See more | Go to post

  • semanticnotion
    replied to Combo Box Search Criteria
    sorry for reply here
    but what this problem tells when i post my question "The message you have entered is too short. Please lengthen your message to at least 1"

    i cant post my question even cant edit the above reply. its a test post.
    See more | Go to post

    Leave a comment:


  • semanticnotion
    replied to Combo Box Search Criteria
    The message you have entered is too short. Please lengthen your message to at least 1

    whats this problem is.....
    i cant post my question.
    See more | Go to post

    Leave a comment:


  • i currently using ubuntu 10.04
    is there any other php function that retrieve system time
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...