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 501215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:10:00+00:00 2026-05-13T06:10:00+00:00

i have 2 questions to ask: first of all, in while ($row = mysql_fetch_object($result))

  • 0

i have 2 questions to ask:
first of all, in while ($row = mysql_fetch_object($result))

i have an object: $row->atitle

now through javascript, i want to print on the page an ++increment of the current object of the array.

i am doing this:

hidephp = document.write("<?php echo .$row->atitle.["+inc+"];"+" ?>");

the above doesnt seem to work. help would be much appreciated.

  • 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-05-13T06:10:01+00:00Added an answer on May 13, 2026 at 6:10 am

    You’ve offered so little to work with, that I’m really not sure of where to begin. I assume that from your post, you’re not using any kind of templating process (you should really look into that)

    Your problem is really that you’re mixing languages that span the client/server relationship. Javascript can do stuff with what the server sends the client, while PHP actually decides what to send in the first place. If you want Javascript to do something with variables in PHP, you should look into using PHP’s json_encode() to do what you want:

    // PHP
    $row = array()
    while ($row = mysql_fetch_object($result)
    {
        $data[] = $row;
    }
    $javascriptFriendlyData = json_encode($data);
    
    
    // Javascript
    data = <?= $javascriptFriendlyData ?>;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to questions concerning database records revision. First of all I have database
I have got a lengthy question to ask. First of all Im still very
Sorry, this's my first time to ask a question here. So, I don't have
I'm very happy of Netbeans 6.5 diff tool, I have to ask some questions
First of all, I apologise if the question I ask here is stupid, I
I have two questions concerning fitting a gauss curve to histogram peaks. My first
While I have been playing with Python for a few months now (just a
First of all I am sorry to ask a stupid question, this is because
I have two 'simple' questions in C++. 1- I want to make a variable
I have seen stackoverflow ask question page they disable button until my postback event

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.