Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8630215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:00:54+00:00 2026-06-12T09:00:54+00:00

cuIzgaraKay is a javascript code I want to use it in sql command as

  • 0

cuIzgaraKay is a javascript code I want to use it in sql command as cuIzgaraKay.id(it gets the value correctly I checked it). However, I could not it. I googled it but I can’t find what I search . How can i do it ? sorry for asking syntax error but I can’t find it maybe ı have logical error

        if(cuIzgaraKay){



          <?php
              include_once('../phps/kutuphane/inc.php');


    $result = mysql_query("select id from bolge_db where parent_id="?>+ cuIzgaraKay.id + <?);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T09:00:55+00:00Added an answer on June 12, 2026 at 9:00 am

    As far as I can tell, you’re trying to execute an SQL query from the PHP page, using data from the Javascript code you’re generating.

    The Javascript is only evaluated on the client side of your page. That means that the server-side cannot know anything about the Javascript code.

    What you need to do, is to generate the ID, and communicate it to the PHP backend, for example with a HTTP POST/GET request or something.

    EDIT:

    If you’re new to Javascript, I’d suggest you look into the native JS object XMLHttpRequest. You use it like this:

    /*
        params:
                url:     relative URL on host, e.g. '/users/morten/data'
                method:  GET, POST, PUT, DELETE, HEAD or OPTIONS
                data:    data to send with request, e.g. POST form-data
                ok_cb:   function to call on success
                fail_db: function to call on failure
    */
    function http_req(url, method, data, ok_cb, fail_cb) {
        var client = new XMLHttpRequest();
        client.onreadystatechange = function () {
            if(client.readyState == this.DONE) {
                if(client.status == 200 || client.status == 302 || client.status == 304)
                    ok_cb(...);
                else
                    fail_cb(...);
            }
        };
        client.open(method, url, true);
        client.send(data);
    }
    

    Or you can use jQuery or a ton of other frameworks to do the same thing.

    EDIT:

    what is method in there how can i write there and how can i get data from php – user1702486

    The method is whatever HTTP request method you want to use. See the wikipedia page for more info: http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods

    This code will POST to /page.php sending a data-string along.
    If the request returns a successful code, the ok-callback will be called.

    // handle HTTP OK
    var ok = function(meth, res, url) {
        console.log("OK: got " + res);
    }
    
    // handle all else
    var fail = function(meth, res, url) {
        console.log("UTTER UTTER FAILURE!\n" + res);
    }
    
    // make a HTTP POST to server/page.php sending the data along
    // you can serialize the data and use XML or JSON or whatever instead
    http_req("/page.php", "POST", "username=usr&password=passw&userid=12345", ok, fail);
    

    On the PHP page, you will need to handle the POST by checking the data and returning an answer if appropriate. Something like this:

    <?php
    if (empty($_POST))
    {
        print_r($_POST);
        ...
        // do something with the data and print something back
    }
    ?>
    

    If you’ve posted “data1=1234&data2=5678&str=hello%20mum” the $_POST array will look like this:

    (
        [data1] => 1234
        [data2] => 5678
        [str] => "hello%20mum"
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.