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 .= '
/*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
Re: Pulling data - stops at spaces
am 24.05.2006 18:45:34 von Brad Bonkoski
How does the data look in your actual database? Perhaps it was not
inserted correctly in the first place?
Andres Figari wrote:
> 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 .= '
';
>
> 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 .= '
';
> }
>
> /*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
Re: Pulling data - stops at spaces
am 24.05.2006 19:09:30 von Bastien Koert
Nah, he just needs to have the value in quotes when its presented as the
html form
bastien
>From: Brad Bonkoski
>To: Andres Figari
>CC: php-db@lists.php.net
>Subject: Re: [PHP-DB] Pulling data - stops at spaces
>Date: Wed, 24 May 2006 12:45:34 -0400
>
>How does the data look in your actual database? Perhaps it was not
>inserted correctly in the first place?
>
>Andres Figari wrote:
>
>>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 .= '
';
>>
>>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 .= '