problem in mysql query

Manish Goyal

Manish Goyal

@manish-r2Hoep Sep 27, 2024
I am facing a problem in Mysql query...
I want to give access to a database created in my computer to my friend
through internet
so i use this
"grant * on manish.* to guru@ipaddress identified by 'pass' "
but when my friend tried to access the database it shows an error
..Please suggest some method ..Is there any problem with query...I mean ...Am I using right query or not???😕

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • Manish Goyal

    Manish Goyal

    @manish-r2Hoep Oct 15, 2009

    cummon ceans
    can anyone help me...??please suggest me something..
  • madhumurundi

    madhumurundi

    @madhumurundi-DfePI4 Oct 15, 2009

    hi,
    for your problem go through this link <snipped><a href="https://www.mssqltips.com" target="_blank" rel="nofollow noopener noreferrer">SQL Server Tips, Techniques and Articles</a>
  • Manish Goyal

    Manish Goyal

    @manish-r2Hoep Oct 15, 2009

    which link dude??
  • gohm

    gohm

    @gohm-F3UUpP Oct 16, 2009

    the link has been removed
  • Manish Goyal

    Manish Goyal

    @manish-r2Hoep Oct 18, 2009

    hey i have not got any reply...
    can't any one solve my problem or my query is ill-logical according to you guys??
  • Manish Goyal

    Manish Goyal

    @manish-r2Hoep Nov 3, 2009

    Hello guys..I have seen most of guys have seen this problem ..but no replies ..But atlast I myself find the solution...
    have a look on this link
    #-Link-Snipped-#
  • Manish Goyal

    Manish Goyal

    @manish-r2Hoep Nov 6, 2009

    Orton39
    My friend Yelgnidroc thanks for your answer.I guess i made a mistake posting the code from the window of the query in Dreamweaver.
    I better give you the full code of the query so you can understand if i make a mistake somewhere.

    Code:
        <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
    {
      $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
    
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
    
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;    
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      }
      return $theValue;
    }
    }
    
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
    {
      $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
    
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
    
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;    
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      }
      return $theValue;
    }
    }
    
    $fromdate_availabilityCheck = "-1";
    if (isset($_session['checkin'])) {
      $fromdate_availabilityCheck = $_session['checkin'];
    }
    $house_availabilityCheck = "-1";
    if (isset($_session ["housenumber"])) {
      $house_availabilityCheck = $_session ["housenumber"];
    }
    $todate_availabilityCheck = "-1";
    if (isset($_session['checkout'])) {
      $todate_availabilityCheck = $_session['checkout'];
    }
    mysql_select_db($database_BookingDB, $BookingDB);
    $query_availabilityCheck = sprintf("SELECT checkin, checkout, housenumber FROM bookings WHERE ((checkin <= %s AND checkout >= %s) AND housenumber = %s) OR ((checkin <= %s AND checkout >= %s) AND housenumber = %s)", GetSQLValueString($fromdate_availabilityCheck, "date"),GetSQLValueString($fromdate_availabilityCheck, "date"),GetSQLValueString($house_availabilityCheck, "text"),GetSQLValueString($todate_availabilityCheck, "date"),GetSQLValueString($todate_availabilityCheck, "date"),GetSQLValueString($house_availabilityCheck, "text"));
    $availabilityCheck = mysql_query($query_availabilityCheck, $BookingDB) or die(mysql_error());
    $row_availabilityCheck = mysql_fetch_assoc($availabilityCheck);
    $totalRows_availabilityCheck = mysql_num_rows($availabilityCheck);
    ?> 
    
    Now i think you can see if all is ok in the query.
    Thanks for your interest
    Thanks orton for showing you interest..My problem is to give access to database that is created in my computer...via internet
    I am using command prompt .....I don't want any code..I simply want a query ..is there any??