Jump to content

Nix

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Posts posted by Nix

  1. Oh, I noticed that very few members actually filled out required data (region and instrument from their profiles)!

    That's why query was returning weird results :D :D

     

    Thank you for your time and effort in solving this "issue", kickstart! :)

     

    King regards!!! ;D

  2. Tnx for reply :)

     

    Worked fine, listing significant amount of users. Also worked when I added

     WHERE prn_user_profile.up_instrument='". $instrument ."' 

    at the end, but not when added

     WHERE prn_user_profile.up_instrument='". $instrument ."' AND prn_user_list.ul_region_id = '". $region ."'

     

    Any way that could be fixed? :(

  3. Hi, mates!

     

    The following query acts very strange,  it returns only 1 result instead of X...

    I might be doing it wrong somewhere :shrug:

    <?php
    $query = "SELECT ul_user_id, ul_nick, ul_region_id, up_user_id, up_instrument FROM prn_user_list, prn_user_profile WHERE
    		(prn_user_list.ul_region_id='". $region ."') 
    		AND (prn_user_list.ul_user_id = prn_user_profile.up_user_id) 
    		AND (prn_user_profile.up_instrument = '". $instrument ."')";	
    $result = mysql_query($query) or die(mysql_error());	
    	while($row = mysql_fetch_array($result)) {
    		echo "User: ". 		$row['ul_nick'] 		."<br />";
    		echo "Region: ". 		$row['ul_region_id'] 	."<br /><br />";
    	}
    }
    ?>
    

     

    Tnx in advance! :shy:

  4. Hi, mates!

     

    I'm having a headache since I tried messing up with mod_rewrite...

     

    The story follows:

    [*]Visitor types: http://abc.example.com

    [*]htaccess calls for http://example.com/profile.php?id=abc and displays abc's profile within abc virtual subdomain

    everything is cool and calm until I try to call any page from root:

    http://abc.example.com/page1.php

    The page doesn't show, neither displays any error. It just returns to the previous page with the same content as before opening page1.php from root.

     

    At the moment, I use the following .htaccess code:

    Options +FollowSymlinks
    RewriteEngine on
    
    # as I hate www, I hide it with this:
    RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
    RewriteRule ^(.*)$ http://%1/$1 [R=301,L] 
    
    RewriteCond %{HTTP_HOST} !^(www\.)?distorzija\.com$ [NC]
    RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.distorzija\.com$ [NC]
    RewriteCond %{DOCUMENT_ROOT}/%2%{REQUEST_URI}/ -d
    RewriteRule [^/]$ %{REQUEST_URI}/ [R=301,L]
    
    # with this I call for user ID and display the content via profile.php
    RewriteCond %{ENV:REDIRECT_STATUS} ^$
    RewriteCond %{HTTP_HOST} !^(www\.)?distorzija\.com$ [NC] 
    RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.distorzija\.com$ [NC] 
    RewriteRule ^(.*)$ /profile.php?username=%2 [QSA,L] 
    
    ErrorDocument 404 /404.php

     

    The point of my agony is: i need to keep the url (abc.example.com) even when opening files from root...

     

    Hope I explained the issue understandable...

     

    Tnx in advance!

    Nix

  5. Hi, mates!

     

    I'm having a headache since I tried messing up with mod_rewrite...

     

    The story follows:

    [*]Visitor types: http://abc.example.com

    [*]htaccess calls for http://example.com/profile.php?id=abc and displays abc's profile within abc virtual subdomain

    everything is cool and calm until I try to call any page from root:

    http://abc.example.com/page1.php

    The page doesn't show, neither displays any error. It just returns to the previous page with the same content as before opening page1.php from root.

     

    At the moment, I use the following .htaccess code:

    Options +FollowSymlinks
    RewriteEngine on
    
    # as I hate www, I hide it with this:
    RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
    RewriteRule ^(.*)$ http://%1/$1 [R=301,L] 
    
    RewriteCond %{HTTP_HOST} !^(www\.)?distorzija\.com$ [NC]
    RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.distorzija\.com$ [NC]
    RewriteCond %{DOCUMENT_ROOT}/%2%{REQUEST_URI}/ -d
    RewriteRule [^/]$ %{REQUEST_URI}/ [R=301,L]
    
    # with this I call for user ID and display the content via profile.php
    RewriteCond %{ENV:REDIRECT_STATUS} ^$
    RewriteCond %{HTTP_HOST} !^(www\.)?distorzija\.com$ [NC] 
    RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.distorzija\.com$ [NC] 
    RewriteRule ^(.*)$ /profile.php?username=%2 [QSA,L] 
    
    ErrorDocument 404 /404.php

     

    The point of my agony is: i need to keep the url (abc.example.com) even when opening files from root...

     

    Hope I explained the issue understandable...

     

    Tnx in advance!

    Nix

  6. You should use utf8_unicode_ci as charset for any table in order to use Cyrillic characters... Also, be sure you've placed this meta in r document:

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

     

    Or, if even then fails, try defining the charset for use with queries:

    $query = "SELECT something FROM somewhere WHERE id = 1";
    mysql_query("SET CHARACTER SET utf8");
    mysql_query("SET NAMES utf8");
    $result = mysql_query($query) or die(mysql_error());
    

     

    cheers!

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.