corbin
-
Posts
8,102 -
Joined
-
Last visited
Posts posted by corbin
-
-
[quote author=Drumminxx link=topic=99151.msg390361#msg390361 date=1151817804]
You just may have the right password but a newer version of mysql uses a different password authentication so you need to tell mysql to use the old password authentication
SET PASSWORD FOR 'zoooz'@'some_host' = [b]OLD_PASSWORD[/b]('mypass');
of course this is only good if you have that kind of access otherwise you'll need to contact your hosting provider
here is some more info on this matter
http://dev.mysql.com/doc/refman/5.0/en/old-client.html
[/quote]
Did it. Same error. -
Connecting to my own computer from a hosted site... Its not a wrong password.... its not a wrong host... My router is set up right... Its something wrong on the hosted side I think... I'm not sure though.
-
So, I'm trying to connect to my MySQL server on my computer from my remotely hosted site... I'm connecting with a script like:
[code]mysql_connect($db_host, $db_user, $db_pass) or die(mysql_error());
mysql_select_db($db_database);[/code]
and I'm getting the error "Client does not support authentication protocol requested by server; consider upgrading MySQL client". I would appreciate it if someone could tell me what is causing that error and if its possible to fix it.
Thanks to anyone who helps. -
Well, I run a small site which checks the status (online/offline) of several servers (13) and the way i have it working is i have the [a href=\"http://l2status.no-ip.org\" target=\"_blank\"]main site[/a] include a page through an IFRAME which includes 4 other pages through IFRAMES. index.php has an IFRAME to status.php which opens IFRAME's to servers/1.php servers/2.php so on. And then in the servers/X.php pages it includes servers/config.php which is this:
[code]<?
error_reporting(0);
while(list($ServerName,$Host)=each($IP))
{
list($IPAddress,$Port)=explode(":",$Host);
if($fp=fsockopen($IPAddress,$Port,$ERROR_NO,$ERROR_STR,(float)0.5))
{
$server[$ServerName]="<font color=\"#00ff00\">Online</font>";
fclose($fp);
}else{
if($fp=fsockopen($IPAddress,$Port,$ERROR_NO,$ERROR_STR,(float)0.5))
{
$server[$ServerName]="<font color=\"#00ff00\">Online</font>";
fclose($fp);
}
else{
$server[$ServerName]="<font color=\"#ff0000\">Offline</font>";
}
}
}
?>[/code]
and an example servers/X.php file is (i changed the IP addresses):
[code]
<body bgcolor="black"text="#FFFFFF">
<?
error_reporting(0);
$IP = array(
"ia_login" =>"000.000.000.000:2106",
"ia_aria"=>"000.000.000.000:7777",
"ia_victoria" =>"000.000.000.000:7777",
);
fclose($fp);
include("config.php"); ?>
<b>
<div align="center" style="font-size: 12; font: bold;">
Login: <? echo $server['ia_login']; ?><br>
Aria: <? echo $server['ia_aria']; ?><br>
Victoria <? echo $server['ia_victoria']; ?><br>
<div align="center">
<? fclose($fp); ?>
[/code]
So anyway... my question is... is there a more efficient way to go about doing the same thing? -
[!--quoteo(post=370015:date=Apr 29 2006, 09:28 PM:name=Corbin)--][div class=\'quotetop\']QUOTE(Corbin @ Apr 29 2006, 09:28 PM) [snapback]370015[/snapback][/div][div class=\'quotemain\'][!--quotec--]
I tried
INSERT VALUES ('INET_ATON('192.168.2.1')') into IP; earlier but it kept putting 0... I also tried other formats and couldnt get it to work... I had it as int though not int unsigned so ill try that right now.
[/quote]
Hehe not sure what i was doing wrong earlier but i got it working now... Thanks for the advice :). -
[!--quoteo(post=370005:date=Apr 29 2006, 08:40 PM:name=fenway)--][div class=\'quotetop\']QUOTE(fenway @ Apr 29 2006, 08:40 PM) [snapback]370005[/snapback][/div][div class=\'quotemain\'][!--quotec--]
I'm sure that the INET functions were supported as far back at 3.23 -- there's nothing "wrong" with storing them as strings, it's just that it becomes useless for anything but logging, and wastes space. INT UNSIGNED is a better choice... simply wrap the dotted-quad in an INET_ATON() call in your INSERT statements. Otherwise, the MySQL component looks just fine... you'll have to get someone else's opinion on the PHP stuff, since I do everything in Perl.
[/quote]
I tried
INSERT VALUES ('INET_ATON('192.168.2.1')') into IP; earlier but it kept putting 0... I also tried other formats and couldnt get it to work... I had it as int though not int unsigned so ill try that right now. -
Why cant
SELECT * FROM table where field = '$itemnum'; be used...? Of course that would all be changed to your stuff, but can mysql not handle hyphens in queries? Or what is the problem? -
[!--quoteo(post=369958:date=Apr 29 2006, 03:39 PM:name=fenway)--][div class=\'quotetop\']QUOTE(fenway @ Apr 29 2006, 03:39 PM) [snapback]369958[/snapback][/div][div class=\'quotemain\'][!--quotec--]
I can't speak to the PHP side... on the MySQL side, I have a few comments:
-mysql_result() is inefficient -- you should be using mysql_fetch_array(), and then retrieiving the desired piece by column name
-if you're already using VARCHARs, there's no reason to have them limited to 20 -- go all the way to 255
-storing IPs as strings is a poor choice, and limits the way you can query this information; use INET_ATON() and store it as an integer.
-you should always explicitly include the column names when you issue INSERT statements... don't rely on the order of the columns never changing
[/quote]
Fixed the mysql_result use for the loop to display the posts... On the detail screen I dont think it will be afftected much since its only querying 1 row and then printing one result. It builds the tables where all the VARCHARs are 255 length now. With the IP thing... I couldnt get INET_ATON to work correctly... I think it's becuase I'm using MySQL 4.1... not sure though. Also, I went through and fixed all the INSERT statements... Anything else you can think of? -
Hmmmm that is hard to think of... Ill try to think of something but for now Imma go to bed..
-
set all 3 as unavailable when one becomes unavailable maybe? Or tell the php script...
if(($p1av == "false") || ($p2av == "false") || ($p3av == "false")) {
$p1av = "false";
$p2av = "false";
$p3av = "false";
} -
Well i got bored the other day so i made a little chat box thing... It simply stores the comments in a table along with some other stuff. Anyways if someone could tell me anything i should have coded different to make the coding shorter or more efficient i would appreciate it. :)
Thanks -Corbin
( get [a href=\"http://corbin.no-ip.org/chat.zip\" target=\"_blank\"]http://corbin.no-ip.org/chat.zip[/a] )
( working copy [a href=\"http://corbin.no-ip.org/dev/chat/index.php\" target=\"_blank\"]http://corbin.no-ip.org/dev/chat/index.php[/a] ) -
Dream weaver does not create MySQL databases. And mysql and postgresql are database types and phpXadmin are what are used to manage those through php scripts... I think you should research databases a little more... ^_^
-
You transfered all you MySQL tables over and stuff didnt you? Same names and everything? Dont forget to change the MySQL host/username/pass to match your new ones.
-
[code] $form1="<table><tr><td>";
$form1.=$retrieved;
$form1.="</td></tr>";
$form1.="<tr><td align=\"right\"><a href=\"$pagename?edit=yes\">Edit</td></tr>";
$form1.="</table>";[/code]
Unless I'm crazy, which I wouldnt doubt that I am, if you define a variable multiple times and then echo it, it will echo the most recent definition...
So try something like
[code]
$form1="<table><tr><td>". $retrieved . "</td></tr><tr><td align=\"right\"><a href=\"" . $pagename . "?edit=yes\">Edit</td></tr></table>";
[/code]
Also, I'm not sure, but I've never seen echo (something) used before... Maybe try echo $form1; -
If i knew what you mean i might be able to help a little, but I'm not sure what you mean. Do you mean have them pay a fee, then they upload an image and it stores it on your server. Then, they all show up in one massive gallery? Or each person has their own gallery?
-
Try something like:
<? $remoteip=$_SERVER['REMOTE_ADDR']; $hostname = gethostbyaddr $remoteip; echo $hostname; ?>
I'm not sure if that will work. I would test it but its very later here and im about to go to bed.
(if that doesnt work, try quotes around $remoteip)
Apologies first, Image uploading....
in PHP Coding Help
Posted