Re: [PHP-DB] Pulling data - stops at spaces

2006-05-24 Thread Andres Figari

Awesome, putting quotes worked!!!

Thanks a lot Brad and Bastien :)
Bastien Koert wrote:

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Pulling data - stops at spaces

2006-05-24 Thread Andres Figari

Hello,

I am sort of new to php and mysql (in regards to experience with it as a 
programmer), so my apologies for the silly questions :)


I am trying to pull text that was entered into a table.  See code 
below.  The only problem seems to be with lines like this:


$rows .= 'Video Title:value='.$row['video_title'].' type=text maxlength=60>';


Say the title is "the title", it only pulls out "the".  I am wondering 
if I am using the wrong method for pulling the data, or if I should 
correct the way I am doing it.  Looking at php.net I see these:


http://www.php.net/manual/en/ref.msql.php

Any suggestions for an alternative method?

thank you for your help :)

Andres


   /* Connecting, selecting database */
   $link = mysql_connect($mysql_host, $mysql_user, $mysql_password) 
or die("Could not connect : " . mysql_error());

   mysql_select_db($mysql_db) or die("Could not select database");

   /* Performing SQL query */
   $query = "SELECT * FROM video where video_id=$video_id";
   $result = mysql_query($query) or die("Query failed : " . 
mysql_error());

   $query2 = "SELECT * FROM artist";
   $result2 = mysql_query($query2) or die("Query failed : " . 
mysql_error());


   /* Converting result of ad_type query into array */
   if ($result) {
   $row = mysql_fetch_array($result);
   $rows .= 'Video 
ID: '.$row['video_id'].'';
   $rows .= 'value='.$row['video_id'].' type=hidden size=20>';
   $rows .= 'Video Title:name=video_title value='.$row['video_title'].' type=text 
maxlength=60>';
   $rows .= 'Recording 
Label:type=text maxlength=60>';
   $rows .= 'HTML 
Attributes';
   $rows .= 'Title - HTML 
Tag:type=text maxlength=60>';
   $rows .= 'Video URL:name=video_url value='.$row['video_url'].' maxlength=60>';
   $rows .= 'Keywords - Meta 
Tag:value='.$row['video_meta_keywords'].' maxlength=847>';
   $rows .= 'Description - Meta 
Tag:value='.$row['video_meta_description'].' 
maxlength=150>';
   $rows .= 'Abstract - Meta 
Tag:value='.$row['video_meta_abstract'].' maxlength=150>';
   $rows .= 'Genres Below (more than 
one can be selected)';
   $rows .= 'Electronica:type="checkbox" name="video_category_electronica">';
   $rows .= 'Rock:type=checkbox name=video_category_rock>';
   $rows .= 'HipHop:type=checkbox name=video_category_hiphop>';
   $rows .= 'Eclectic:type=checkbox name=video_category_eclectic>';
   $rows .= 'Humor:type=checkbox name=video_category_humor>';
   $rows .= 'Other:type=checkbox name=video_category_other 
value='.$row['video_category_other:q'].'>';

   }

   /*Converting result of artist query into array */
   if($result2){
   $num_rows2 = mysql_num_rows($result2);
   for($i=0;$i<$num_rows2;$i++){
   $row2 = mysql_fetch_array($result2);
   $artist_choice .= 'value='.$row2['artist_id'].'>'.$row2['artist_name'];

   }
   }

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] MySQL Connection FailedL

2001-09-16 Thread Andres Figari

Hi,

I'm trying to get IRM to work with my MySQL server.  IRM uses php3. It
worked for a bit (entry 30 form the MySQL log as shown below).   Suddenly,
affter fidling with (i believe this is what it was) the file php.ini I know
get this:

Warning: MySQL Connection Failed: Access denied for user: 'apache@localhost'
(Using password: NO) in ./irm.inc on line 83
Warning: MySQL Connection Failed: Access denied for user: 'apache@localhost'
(Using password: NO) in ./irm.inc on line 84
Warning: MySQL: A link to the server could not be established in ./irm.inc
on line 84

The MySQL log files say this:
010916  7:06:03  30 Connectapache@localhost on
 30 Init DBirm
 30 Query  SELECT * from users where (name = 'admin'
&& password = 'admin')
 30 Query  SELECT * FROM prefs WHERE (user =
'Admin')
 30 Quit 010916  7:10:36
 31 ConnectAccess denied for user:
'apache@localhost' (Using password: YES)

I tried using the database with the user and password and it worked.  For
some reason I think that there is a miscommunication between the php page
and mysql in that php says "Using password: NO" and MySQL says "Using
password: YES".  I cannot remember what I changed unfortunately :( Has
anyone encountered this before who can give me a freindly tip?

Andres





-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]