[PHP] Re: IP and gethostbyaddr() --- difference?
test, ignore Martin Zvarík mzva...@gmail.com escribió en el mensaje de noticias news:f0.ac.47862.f2544...@pb1.pair.com... Hello, I am doing a view stats for my website. I've seen that many of such statistic scripts store two values to identify the visitor: IP and getHostByAddr(IP) I've been searching..., but I don't get why the IP address isn't enough by itself?! What is the getHostByAddr() = Internet host name for? When IP changes the hostname does too and vice-versa? What's the difference between these two values? And why do I need both of them? Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] apache and PHP / Eclipse
I am having a hard time trying to get some pages work. I have PHP 5.2.8, Apache 2.2 and MySQL 5.1 running in a Windows Vista home edition. All packages were installed, and configured, the strange thing is that pages commonly work but when I add a new line (e.g. an echo line) with a dummy text, Apache crashes and it is restarted I am using Eclipese europa to create the code e.g. I have this code and the page works: include 'upper_pagina.php'; include 'forma.php'; $link = mysql_connect(127.0.0.1,root,root); if (!$link) { echo table width='100%' border='0' cellspacing='0' cellpadding='5' bordercolor='FF'\n; echo tr\n; echo td bgcolor='FF9327'\n; echo bLa Base de datos no esta disponible en este momento.BR; echo Disculpe las molestias, intente mas tarde/b; echo /td\n; echo /tr\n; echo /table\n; } mysql_select_db(estoydevacacionesdb) or die(No pudo seleccionarse la BD.); $busquedasql1 = select * from servicios; include 'bottom_pagina.php'; but if I add a new line ($servicios1 = mysql_query($busquedasql1);) before the last include line, apache crashes, it has been very hard for me to identify what it is causing this problem any clue ? Regards Eduardo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Gathering data
Hi, I have a web site where the customer can look for some info based on a destination either by making a click on a link or entering the destination name in a field in a html form What is the best way to store that sort of info ? meaning that I want to store the event of making a click on a certain link OR entering the destination in the field and hitting the search button, I would like to know how many hits a link has or how many times the same (or similar) text was entered Any recommendation on how to make this happen ? Regards, Eduardo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_fetch_array
Hi guys After doing some changes, I believe it is partially working, what I did is the following: while($row=mysql_fetch_array($fotos)) { $fotos_mostrar[] = $row; } $primer_foto = reset($fotos_mostrar[0]); // This is to set the pointer to the first record echo $primer_foto; // This displays the first column when doing a SELECT However, my SELECT statement retrieves 2 columns from one table, how do I display the second column ? Thanks Eduardo Jim Lucas [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] Eduardo Vizcarra wrote: I have a WHILE sentence to retrieve all records from a SELECT query in a database and am using mysql_fetch_array to store them in a matrix, the sentence is like this: while($row=mysql_fetch_array($fotos)) { $fotos_mostrar[] = $row; } $fotos contains all records found in a db table, the SELECT statement is retrieving 2 columns from a table, how do I store all records in a 2 dimention table so I can use it later ? this WHILE sentence seems to only store the last record only Regards how are you checking to see the contents of the $fotos_mostrar array() ? just after the while loop ends, do a var_dump() or print_r() on the array and view the contents. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql_fetch_array
I have a WHILE sentence to retrieve all records from a SELECT query in a database and am using mysql_fetch_array to store them in a matrix, the sentence is like this: while($row=mysql_fetch_array($fotos)) { $fotos_mostrar[] = $row; } $fotos contains all records found in a db table, the SELECT statement is retrieving 2 columns from a table, how do I store all records in a 2 dimention table so I can use it later ? this WHILE sentence seems to only store the last record only Regards -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_fetch_array
Yes, matrix has been defined just before this WHILE sentence Cristian Vrabie [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] this is most peculiar. your code should do exactly what you expect. have you initialized the $fotos_mostrar array before the while loop? $fotos_mostrar = array(); Eduardo Vizcarra wrote: I have a WHILE sentence to retrieve all records from a SELECT query in a database and am using mysql_fetch_array to store them in a matrix, the sentence is like this: while($row=mysql_fetch_array($fotos)) { $fotos_mostrar[] = $row; } $fotos contains all records found in a db table, the SELECT statement is retrieving 2 columns from a table, how do I store all records in a 2 dimention table so I can use it later ? this WHILE sentence seems to only store the last record only Regards -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Too many records to display in one web page
Hi All I am developing a web site that interacts with a MySQL database. When I run a query and display the records in a web page, this can become a problem because there might be too many records to be displayed in one single web page so I am trying to divide the total number of records and display them in multiple pages. Let's say, if the query returns 100 records then I would like to display the first 10 records and then put a navigation bar where I can go to the next 10 or return to the previous 10 records Is this done at a SQL or PHP level ? any experience on doing this ? Thanks a bunch Eduardo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Random SELECT SQL list
Hi Larry,Paul,Zoltán Thanks for your messages, adding ORDER BY RAND () worked just fine :) Eduardo Larry Garfield [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] On Wednesday 16 May 2007, Eduardo Vizcarra wrote: Hi I would like to know if a SELECT SQL query list of records can be unsorted. SELECT statement retrieves a list of records from a certain table starting from record # 1 till record #N and when publishing the records, this is how it is presented, in a sequential way, is there any way to not present them in a sequential way ? e.g. if a user accesses a web page then he will see record #3 and then #7 and so on, another user accesses the same web page and he might see record #8 and then record#2. etc any experience on how to do this ? This is really an SQL question, but it's quite easy. Assuming MySQL: $result = mysql_query(SELECT * FROM foo WHERE bar='baz' ORDER BY RAND()); // Do stuff here. -- Larry Garfield AIM: LOLG42 [EMAIL PROTECTED] ICQ: 6817012 If nature has made any one thing less susceptible than all others of exclusive property, it is the action of the thinking power called an idea, which an individual may exclusively possess as long as he keeps it to himself; but the moment it is divulged, it forces itself into the possession of every one, and the receiver cannot dispossess himself of it. -- Thomas Jefferson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Random SELECT SQL list
Hi I would like to know if a SELECT SQL query list of records can be unsorted. SELECT statement retrieves a list of records from a certain table starting from record # 1 till record #N and when publishing the records, this is how it is presented, in a sequential way, is there any way to not present them in a sequential way ? e.g. if a user accesses a web page then he will see record #3 and then #7 and so on, another user accesses the same web page and he might see record #8 and then record#2. etc any experience on how to do this ? Regards Eduardo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php