SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Zealot ggnetworks's Avatar
    Join Date
    Mar 2005
    Posts
    169
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    having this sql problem when installing a script

    Hi i am installing a script at
    http://64.34.91.146/~sallu/ . Now the problem is im gettin the following error when someone tries to click on an ablum:

    For example on this page it says
    PHP Code:
    SELECT FROM WHERE movieID '' 
    so the problem is its not selecting * from movieID table.

    How ever whats pissing me off is that its working fine on other servers as i jus tried on diff hosting servers, SO its just my server its not working on.

    Any way to fix this problem?

  2. #2
    SitePoint Enthusiast jR³'s Avatar
    Join Date
    Sep 2003
    Location
    belgium
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    SELECT * FROM WHERE movieID = ''
    euhm I think you forgot the tablename in this query..
    select * from albums where.. probably

  3. #3
    SitePoint Evangelist luxinterior's Avatar
    Join Date
    Aug 2004
    Location
    Here, there and everywhere!
    Posts
    458
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Take a look at the script as it writes the urls. I'm pretty sure it shouldn't be appending '.php. on the end (http://64.34.91.146/~sallu/view.php?...vie&id=533.php).

    Lux

  4. #4
    SitePoint Zealot ggnetworks's Avatar
    Join Date
    Mar 2005
    Posts
    169
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    but why is it working fine on my friends server?

    here is line from the view.php

    PHP Code:
    $sql_text "SELECT * FROM $music WHERE movieID = '$id'"
    shall i post the full view.php code?

  5. #5
    SitePoint Zealot ggnetworks's Avatar
    Join Date
    Mar 2005
    Posts
    169
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    here is the full view.php code

    PHP Code:
    <?php

    include ("templates/config.php");

    mysql_connect($hostname$dbuser$dbpass)  or  die( "Unable  to  connect to  SQL  server.  Please email: myemail@gmail.com about this error."); 

    @
    mysql_select_db"$dbName")  or  die( "Unable  to  select  database");



    $sql_text "SELECT * FROM $music WHERE movieID = '$id'";  

    $query mysql_query($sql_text) or die($sql_text); 



    while (
    $result mysql_fetch_array($query))



    {  



    include (
    "templates/header.inc");

    include (
    "templates/music_top.inc");



    IF (
    $music=="ghazals"):  

    include (
    "templates/otherdetails.inc");

    ELSE:

    ENDIF;



    IF (
    $music=="love"):  

    include (
    "templates/otherdetails.inc");

    ELSE:

    ENDIF;



    IF (
    $music=="old"):  

    include (
    "templates/moviedetails.inc");

    ELSE:

    ENDIF;



    IF (
    $music=="shaadi"):  

    include (
    "templates/otherdetails.inc");

    ELSE:

    ENDIF;



    IF (
    $music=="tamil"):  

    include (
    "templates/otherdetails.inc");

    ELSE:

    ENDIF;



    IF (
    $music=="telugu"):  

    include (
    "templates/otherdetails.inc");

    ELSE:

    ENDIF;



    IF (
    $music=="qawali"):  

    include (
    "templates/otherdetails.inc");

    ELSE:

    ENDIF;



    IF (
    $music=="pop"):  

    include (
    "templates/pashtosoundtracksdetails.inc");

    ELSE:

    ENDIF;



    IF (
    $music=="remix"):  

    include (
    "templates/pashtosoundtracksdetails.inc");

    ELSE:

    ENDIF;



    IF (
    $music=="bhangra"):  

    include (
    "templates/otherdetails.inc");

    ELSE:

    ENDIF;



    IF (
    $music=="pashto"):  

    include (
    "templates/pashtosoundtracksdetails.inc");

    ELSE:

    ENDIF;



    IF (
    $music=="movie"):  

    include (
    "templates/moviedetails.inc");

    ELSE:

    ENDIF;



    IF (
    $music=="bollyVideo"):  

    include (
    "templates/videodetails.inc");

    ELSE:

    ENDIF;



    IF (
    $music=="trailer"):  

    include (
    "templates/videodetails.inc");

    ELSE:

    ENDIF;

    ?>



    <br>

    <font class=tracklisting>

    <?PHP

    IF ($music=="ghazals"):  

    include (
    "templates/othertracklisting.inc");

    ELSE:

    ENDIF;



    IF (
    $music=="love"):  

    include (
    "templates/othertracklisting.inc");

    ELSE:

    ENDIF;



    IF (
    $music=="old"):  

    include (
    "templates/movietracklisting.inc");

    ELSE:

    ENDIF;



    IF (
    $music=="shaadi"):  

    include (
    "templates/othertracklisting.inc");

    ELSE:

    ENDIF;



    IF (
    $music=="tamil"):  

    include (
    "templates/othertracklisting.inc");

    ELSE:

    ENDIF;



    IF (
    $music=="telegu"):  

    include (
    "templates/othertracklisting.inc");

    ELSE:

    ENDIF;



    IF (
    $music=="qawali"):  

    include (
    "templates/othertracklisting.inc");

    ELSE:

    ENDIF;



    IF (
    $music=="pop"):  

    include (
    "templates/pashtotracklisting.inc");

    ELSE:

    ENDIF;



    IF (
    $music=="remix"):  

    include (
    "templates/pashtotracklisting.inc");

    ELSE:

    ENDIF;



    IF (
    $music=="pashto"):  

    include (
    "templates/pashtotracklisting.inc");

    ELSE:

    ENDIF;



    IF (
    $music=="bhangra"):  

    include (
    "templates/othertracklisting.inc");

    ELSE:

    ENDIF;



    IF (
    $music=="movie"):  

    include (
    "templates/movietracklisting.inc");

    ELSE:

    ENDIF;



    IF (
    $music=="bollyVideo"):  

    include (
    "templates/pashtotracklisting.inc");

    ELSE:

    ENDIF;



    IF (
    $music=="trailer"):  

    include (
    "templates/othertracklisting.inc");

    ELSE:

    ENDIF;

    ?>

    <br>

    <p align=center>

    <input type="hidden" value="<? echo "$result[starring]"?>" name="starring">

    <input type="hidden" value="<? echo "$result[director]"?>" name="director">

    <input type="hidden" value="<? echo "$result[server]"?>" name="pyar">

    <input type="hidden" value="<? echo "$result[album]"?>" name="album">

    <input type="hidden" value="<? echo "$result[image]"?>" name="image">

    <input type="hidden" value="<? echo "$result[rating]"?>" name="rating">



    <input type=button value='Select All' class='button' onClick="SelectAll()" name="button">

    <input type=button value='Clear All' class='button' onClick="InvertSelect()" name="button">

    <input type=submit value='Play Selected' class='button'>

    </form>

    <br>



    <?

    include (
    "templates/footer.inc");
    ?>

  6. #6
    SitePoint Enthusiast jR³'s Avatar
    Join Date
    Sep 2003
    Location
    belgium
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How are the get variables assigned in config.php
    or are they auto assigned with register_globals?
    I think register_globals was set to On on your friends server,
    where it is set to Off on your server,
    Check the php.ini file.
    you should also take notice off the dangerous effects when using this directive,
    http://us2.php.net/register_globals

  7. #7
    SitePoint Zealot ggnetworks's Avatar
    Join Date
    Mar 2005
    Posts
    169
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok which exact file do i have to edit to turn it on?

    i added

    PHP Code:
    use php_flag register_globals 0 
    in the .htaccess file .

    Will that help?

  8. #8
    SitePoint Enthusiast jR³'s Avatar
    Join Date
    Sep 2003
    Location
    belgium
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can use a htaccess file, but this will only have effect on the current site
    it should be:
    use php_flag register_globals 1
    or else (if you have enough priviliges)
    you can edit the php.ini (all sites on your server)
    file that probably is located under /etc/php.ini or /usr/local/lib/php.ini

  9. #9
    SitePoint Zealot ggnetworks's Avatar
    Join Date
    Mar 2005
    Posts
    169
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks a lot all.

    its fixed


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •