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

The Archive Base Latest Questions

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

I am not sure what is happening with my code, My project is running

  • 0

I am not sure what is happening with my code, My project is running smoothly under XAMPP Server, i am able to make connection between mysql and php, But when i moved this to another system, which has mysql community server, their the code is not working, i mean database is connecting, but not able to fetch data from the database.

Sample Code is as follows:

$host='localhost'; // Host name
$username='root'; // Mysql username
$password=''; // Mysql password
$db_name='test'; // Database name
$connect=@mysql_connect($host,$username,$password) or die("Cannot Connect to database");
@mysql_select_db($db_name,$connect) or die ("Cannot find database");

app Code:

 $sql="SELECT * FROM test.userdet WHERE emailId='$uName' and pwd='$pwd'";
 $result=mysql_query($sql);
 $count=mysql_num_rows($result);

according to $count i am redirecting it to other page.

I able to run it on other systems which has XAMPP itself, but its not running with mysql community server.

//Thanks to NullPointer, i got it by PDO, from now onwords i will continue with PDO for transactions.

Now i facing a new problem, i am calling a php_db script via ajax, after executing all PDO statements its not returning to ajax, Code snippet is below:

ajax call:-

  $.ajax({
      type: "POST",
      url: "common/dbPhpScripts/updateEvent.php",
      data: 'json=' + det,
      dataType: 'json',
      cache: false,
      success: function () {
          $('#cal').fullCalendar('refetchEvents');
          $('#edit_event').dialog('close');
      }
  });

sample php code after using PDO:

$stringData = $_POST['json'];
$mynewarray = json_decode($stringData, true);
$title=$mynewarray['title'];
$start= $mynewarray['start'];
$end= $mynewarray['end'];
$createDate=$mynewarray['createDate'];
$insertQuery=$db->exec("INSERT INTO calendar (User_Id, StartDateTime, EndDateTime, Event_Title, Create_Date) VALUES ('07','$start','$end','$title','$createDate')");

where i am going wrong?

  • 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:48:32+00:00Added an answer on June 18, 2026 at 12:48 pm

    its good to see what you getting in

    success: function (data) {
       alert("data");
    }
    

    also you need to echo result in common/dbPhpScripts/updateEvent.php not redirect if you redirect you wont get result in ajax

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

Sidebar

Related Questions

I'm not sure what is happening in this line of javascript: alert( (''+[][[]])[!+[]+!+[]] );
I am not exactly sure what's happening here - I open a terminal window
I'm not sure exactly where this is happening, but what I'm trying to do
I'm not entirely sure why this crash is happening and I'd like to get
Im not sure why is this happening but there is a piece of viewstate
Last night I asked a question like this, I'm not sure what's happening and
I'm not sure what is happening with this app. It worked fine then one
Not sure whats going on here, or what could be the integer in this
Not sure if im just being stupid or something but here goes i work
Not sure how to ask this, but i'll give it a try: I have

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.