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

  • Home
  • SEARCH
  • 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 9258011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:17:09+00:00 2026-06-18T12:17:09+00:00

<script type=text/javascript> $(function() { $(‘#jo’).flexbox({ results: [ { id: 1, name: 002155 }, {

  • 0
        <script type="text/javascript">  
            $(function() {
$('#jo').flexbox({  
        "results": [  
            { "id": "1", "name": "002155" },  
            { "id": "2", "name": "002155" },
            { "id": "3", "name": "asdasdasd" }
        ]}, 
    {  
showArrow: false  
});
            });  
        </script>

This code at top is the records that will suggest by the flexbox, for example ill type 00 it has two suggestion the 002155 and 002155, but the problem is the result of the word suggested is static, i read some code coming from this site that they link a php page to be use as the database. here is the sample…

$("#suggest").flexbox('back/search.php', {

this code above is from:jquery flexbox ? i try to make some alternative to be able to use mysql as the result of the word suggestion;

        <script type="text/javascript">  
            $(function() {
$('#jo').flexbox({  
        "results": [  
    <?php
        $con = mysql_connect("localhost","root","");

        mysql_select_db("accom");
        $query = mysql_query("select * from myproject");
            while($i = mysql_fetch_array($query))
            {
                $ii++;
                print"{ id : ".$ii.", name: ".$i[per_name]." },";       
            }
    ?>
        ]}, 
    {  
showArrow: false  
});
            });  
        </script>

but it doesnt work ;-(, help me please, to make the source of the word suggestion is coming from a sql query, thank you guys..

by the way here is my table

myproject
per_id(int 100)auto_increment
per_name(varchar 100)
  • 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-18T12:17:11+00:00Added an answer on June 18, 2026 at 12:17 pm

    Generated json is not valid.

    In fact, parameter don’t include second parameter (since you close object with ‘}’) and names values are strings, so you probably need to add quote.

        <script type="text/javascript">  
            $(function() {
                $('#jo').flexbox({  
                    "results": [  
                        <?php
                            $con = mysql_connect("localhost","root","");
                            mysql_select_db("accom");
                            $query = mysql_query("select * from myproject");
                            while($i = mysql_fetch_array($query))
                            {
                                $ii++;
                                print"{ id : ".$ii.", name: '".$i[per_name]."' },";       
                            }
                        ?>
                    ], 
                    showArrow: false  
                 });
            });  
            </script>
    

    Be careful, you should need to espace name values in case name contains quote characters.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've made this to try to extract text. <script type = text/javascript> function extractText(node){
Can someone show me whats wrong with this: <html> <script type = text/javascript> function
This my javascript :- <script type =text/javascript> $(function() { $(#tabs).tabs({ cache: true ,fx: {
Look this code: <script type = text/javascript> function mouseClick (container) { container.appendChild (document.createTextNode (Can
<script type = text/javascript> function functionCall(){ ... } </script> <input type=image src=uri1.png onclick=this.src='uri2.png'/> this
I have this jsonp function: function jsonp(url, callback) { var script = document.createElement(script); script.setAttribute(type,text/javascript);
I have this code: <script type=text/javascript> function js() { var getJs = document.getElementById(jogo); if
< script type = text/javascript > $(function() { var oAllLinksTable = $(#mydatatable).dataTable({ bProcessing: false,
I have this code <html> <head> <script src=jquery-1.7.2.min.js type=text/javascript></script> <script src=jquery-ui-1.8.20.custom.min.js type=text/javascript></script> <script type
i have a jquery post like that <script type = text/javascript > $(document).ready(function() {

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.