Nezinītis Posted May 27, 2010 Author Report Share Posted May 27, 2010 Funkcija S() - function S($str) { return("'".mysql_real_escape_string($str)."'"); } Kvoutes tak nav pie vainas, ar pārejo nav problēmu, stōro pareizi datus, bet tieši ip nē. :x Quote Link to comment Share on other sites More sharing options...
Maris-S Posted May 27, 2010 Report Share Posted May 27, 2010 Izvadi ar echo pašu vaicājumu kā rakstīju iepriekš. Parādi kāds viņš vispār izskatās. Quote Link to comment Share on other sites More sharing options...
Nezinītis Posted May 27, 2010 Author Report Share Posted May 27, 2010 ar echo vai print_r šim vaicājumam - $kveerijs=mysql_query("INSERT INTO issues (subject, content, type, project_id, user_id, status, ip_add) VALUES (".S($subject).",".S($content).",".S($type).",".S($project_id).",".S($_SESSION['u_id']).",".S($veert_main).",inet_aton('".$ip."'))")or die(mysql_error()); izvada tikai vieninieku. :x Quote Link to comment Share on other sites More sharing options...
p4F Posted May 27, 2010 Report Share Posted May 27, 2010 echo "INSERT INTO issues (subject, content, type, project_id, user_id, status, ip_add) VALUES (".S($subject).",".S($content).",".S($type).",".S($project_id).",".S($_SESSION['u_id']).",".S($veert_main).",inet_aton('".$ip."'))" un mēģini caur phpmyadmin iepostēt izvadūti Quote Link to comment Share on other sites More sharing options...
Nezinītis Posted May 27, 2010 Author Report Share Posted May 27, 2010 Neizmantoju nekādus phpmyadminus, strādāju ar lamp un visu daru caur konsoli. echo - INSERT INTO issues (subject, content, type, project_id, user_id, status, ip_add) VALUES ('Labdien!','GTPS projektā ir ieviesusies problēma. :x','Programmēšanas kļūda','14','32','Nenoteikts',inet_aton('::1'))ai ai ai ai Quote Link to comment Share on other sites More sharing options...
briedis Posted May 27, 2010 Report Share Posted May 27, 2010 Kā redzi, $ip nesatur nekādu IP... Quote Link to comment Share on other sites More sharing options...
Nezinītis Posted May 27, 2010 Author Report Share Posted May 27, 2010 iegūstu viņu šādi - $ip=$_SERVER['REMOTE_ADDR'] mājas uz Windowsa strādājot.. viņš paņem smuku 127.0.0.1 ip, bet te kaut ::1. Kaut kas ar IPv ? vai pašu tīklu? Quote Link to comment Share on other sites More sharing options...
Леший Posted May 27, 2010 Report Share Posted May 27, 2010 $ip=$_SERVER['REMOTE_ADDR']; echo $ip; Quote Link to comment Share on other sites More sharing options...
Maris-S Posted May 27, 2010 Report Share Posted May 27, 2010 Ko izvada: echo($_SERVER['REMOTE_ADDR']); ? Quote Link to comment Share on other sites More sharing options...
Nezinītis Posted May 27, 2010 Author Report Share Posted May 27, 2010 Izvada: ::1 Quote Link to comment Share on other sites More sharing options...
xPtv45z Posted May 27, 2010 Report Share Posted May 27, 2010 http://bugs.mysql.com/bug.php?id=48594 Quote Link to comment Share on other sites More sharing options...
Nezinītis Posted May 27, 2010 Author Report Share Posted May 27, 2010 Sanāk, ka ar IPv4 viss būs štokos un problēmas būs ar tiem, kuriem būs jaunās IPv6 adreses? Quote Link to comment Share on other sites More sharing options...
codez Posted May 27, 2010 Report Share Posted May 27, 2010 Lai viss būtu saderīgs ar IP6V, konvertē PHP pusē ar inet_pton un MySQL izmanto lauku varbinary(16) Quote Link to comment Share on other sites More sharing options...
Nezinītis Posted May 27, 2010 Author Report Share Posted May 27, 2010 Lai viss būtu saderīgs ar IP6V, konvertē PHP pusē ar inet_pton un MySQL izmanto lauku varbinary(16) thq. viss čoko. :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.