[PHP-DB] mysql limit
If I select rows with a limit clause I need to know if there are more rows than the limit. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] mysql_fetch_object
I'm using $row = mysql_fetch_object and I can reference column names by $row-name but how do I reference a pseudo column (that I make, like substring( name from 1 ))? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] mysql_fetch_object
On 06/28/2004 12:07 PM Larry E.Ullman spoke: I'm using $row = mysql_fetch_object and I can reference column names by $row-name but how do I reference a pseudo column (that I make, like substring( name from 1 ))? Use an alias in your query: SELECT column, DATE_FORMAT('%m', date_column) AS d FROM table ... $row-d Larry Great, thanks. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] mysql_fetch_object
On 06/28/2004 12:07 PM Larry E.Ullman spoke: I'm using $row = mysql_fetch_object and I can reference column names by $row-name but how do I reference a pseudo column (that I make, like substring( name from 1 ))? Use an alias in your query: SELECT column, DATE_FORMAT('%m', date_column) AS d FROM table ... $row-d Larry How does it handle fully qualified conflicting columns, like 'select a.name, b.name from a, b'? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] mysql_fetch_object
How does it handle fully qualified conflicting columns, like 'select a.name, b.name from a, b'? It won't handle that properly; in your example $row-name would be b.name (it'd overwrite a.name). You have to alias same-named columns. Hans Ok, I don't have that case but I was curious. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: [PHP] update count
On 06/16/04 09:53 John Nichel spoke: Bob Lockie wrote: What is the best way to only do an update if it going to update only one row? I want to protect my code so that it won't accidentally update more than one row. I can do a select first but there must be an easier way. :-) UPDATE thisDB.thisTable SET thisTable.thisColumn = 'thisValue' WHERE thisTable.uniqueColumn = 'someUniqueValue' Ok, a primary key is unique, right? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] forum test
Seabird wrote: I'll look into it, thanx, can you access the jump-menu?? Forum should be all the way in the bottom. The jump menu doesn't work. I think you nad a 'name' field for each option... of your select... box. Jacco -- http://seabird.jmtech.ca Attitude is Everything! But Remember, Attitudes are Contagious! Is Yours worth Catching Mignon Hunter [EMAIL PROTECTED] wrote in message news:1036610707.1915.12.camel;joboo.tic.toshiba.com... I'm using Mozilla. I dont see the word 'forum' I guess your onChange=loadIframeJumpMenu doesnt work ? Or the type of javascript your using isnt supported by Mozilla. BTW the nedstat failed to connect on first try. On Wed, 2002-11-06 at 12:25, Seabird wrote: Hi everyone, I just uploaded my forum and would like to have it field tested by everyone. It'll prob still have some bugs in there. http://seabird.jmtech.ca go to website and then click on forum. please ignore the login in the left top for now, Jacco -- http://seabird.jmtech.ca Attitude is Everything! But Remember, Attitudes are Contagious! Is Yours worth Catching -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- From Mozilla and GNU/Linux -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: persistant database connections
Richard Allsebrook wrote: There's a whole world of difference between 'rendered' and 'processed - the page is processed top to bottom (baring any branching in your php) - and generally rendered from top to bottom - some parts being rendered after as the missing components (images etc) are loaded. Thanks. From Mozilla and GNU/Linux -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] error messages to variables
Jason Wong wrote: On Monday 04 November 2002 12:10, Bob Lockie wrote: You can suppress the error message on failure by prepending a http://www.php.net/manual/en/language.operators.errorcontrol.php to the function name.. How can you get the error string into a local variable? Look at the track_errors setting in php.ini. Thanks. -- From Mozilla and GNU/Linux -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] persistant database connections
I'm using mysql_pconnect(...) at the beginning of a PHP page. Can I safely use mysql_select_db(...) later on the page? I thought I read somewhere that you can't rely on HTML to be rendered from top to bottom. Can I rely on PHP to be interpreted from top to bottom? From Mozilla and GNU/Linux -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] error messages to variables
You can suppress the error message on failure by prepending a http://www.php.net/manual/en/language.operators.errorcontrol.php to the function name.. How can you get the error string into a local variable? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Connecting to DB on separate server?
Cassy M Rowe wrote: I have a php page on server #1 trying to access a database on server #2. What do I put in the following blanks: $hostname: ___ (have tried IP, http, localhost, nothing works) $username: blah $password: blah $database: _ $link=mysql_connect($hostname, $user, $pass) or die(Failure to communicate with database); $close=mysql_select_db($database, $link); All I get is the Failure to communicate. message. Server #1: ellerweb.eller.arizona.edu Server #2: datamonster.sbs.arizona.edu $database is cassy, but do I need to add anything to that? I've tried asking two people who are really good at this and they have no answers. THANK YOU IN ADVANCE! Cassy Rowe Maybe you have to specify the port of the database on the remote machine. Maybe the MySQL daemon is not running? -- From Mozilla and GNU/Linux -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Dropdown list question...
I am populating a dropdown list from a database. This is working fine with one minor glitch... For some reason, the first entry in the database does not seem to be getting populated into the list. I do not see anything wrong, and was hoping that someone else might be able to spot a problem. Here is the code that generates the dropdown list: $query_systems = SELECT Name FROM systems; $systems = mysql_query($query_systems, $Test) or die(mysql_error()); $row_systems = mysql_fetch_assoc($systems); $totalRows_systems = mysql_num_rows($systems); $sys_list = select size=\1\ name=\system\\n; $sys_list .= optionSystem Name/option\n; $sys_list .= option---/option\n; while($name = mysql_fetch_row($systems)) { $sys_list .= option$name[0]/option\n; } $sys_list .= /select\n; mysql_fetch_assoc (http://www.php.net/manual/en/function.mysql-fetch-assoc.php) and mysql_fetch_row (http://www.php.net/manual/en/function.mysql-fetch-row.php) both return a row. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php