Get support from Xavier Media
It is currently Sun Dec 08, 2013 12:14 pm

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: how to output (substr)function????
PostPosted: Mon Oct 27, 2008 10:58 am 
Offline
Rookie (I'm probably spamming)
Rookie (I'm probably spamming)

Joined: Mon Oct 27, 2008 9:07 am
Posts: 4
Points: 0
please i have this problem any one can help me?????

i want to display the output of this script:

/*
Database name= dost
Table name= farmwda
Field name= drezha
*/


$con=mysql_connect("localhost","root");
if(!$con){
die('could not connect:'.mysql_error());
}

mysql_select_db("dost",$con);
mysql_query("set names 'utf8'");

$result = mysql_query("SELECT substr(drezha,0,150) FROM farmwda WHERE ID LIKE '1' ") ;

if ($result && mysql_num_rows($result)>0)
{
while ($rows = mysql_fetch_array($result))
{
echo $rows['drezha']."<br>";
}
}else{
echo "nothing found";
}
mysql_query("set names 'utf8'");

mysql_close($con);


thanks for your reply


Report this post
Top
 Profile Send private message E-mail  
Reply with quote  
 Post subject: Re: how to output (substr)function????
PostPosted: Mon Oct 27, 2008 7:54 pm 
Offline
XavierForum.com Admin
XavierForum.com Admin
Super VIP Member
Super VIP Member
User avatar

Joined: Tue Mar 15, 2005 4:37 pm
Posts: 1082
Location: Sweden
Points: 1500
Don't you get any output at all or do you just get "nothing found" because I can't really see any problems (but then I haven't test run the script only looked at the code).

/Andreas

_________________
Xavier Media®
Join me at LinkedIn | Get your latest blog post in your signature you too


Report this post
Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: how to output (substr)function????
PostPosted: Mon Oct 27, 2008 9:16 pm 
Offline
Rookie (I'm probably spamming)
Rookie (I'm probably spamming)

Joined: Mon Oct 27, 2008 9:07 am
Posts: 4
Points: 0
dear nothing display me
yes i know there is no problem and error in my cod so i don't know why no data display during output???????????????


Report this post
Top
 Profile Send private message E-mail  
Reply with quote  
 Post subject: Re: how to output (substr)function????
PostPosted: Tue Oct 28, 2008 8:06 pm 
Offline
XavierForum.com Admin
XavierForum.com Admin
Super VIP Member
Super VIP Member
User avatar

Joined: Tue Mar 15, 2005 4:37 pm
Posts: 1082
Location: Sweden
Points: 1500
If I where you I would try to change this code:
Code:
if ($result && mysql_num_rows($result)>0)
{
while ($rows = mysql_fetch_array($result))
{
echo $rows['drezha']."<br>";
}
}else{
echo "nothing found";
}
to something like
Code:
if (mysql_num_rows($result) == 0)
{
       echo "nothing found";
}
while ($rows = mysql_fetch_array($result))
{
       echo $rows['drezha']."<br>";
}


Also make sure you got something in the database to display.

/Andreas

_________________
Xavier Media®
Join me at LinkedIn | Get your latest blog post in your signature you too


Report this post
Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: how to output (substr)function????
PostPosted: Thu Oct 30, 2008 9:22 am 
Offline
Rookie (I'm probably spamming)
Rookie (I'm probably spamming)

Joined: Mon Oct 27, 2008 9:07 am
Posts: 4
Points: 0
dear i try your code but the result is same thing :(

please can you test this script in your computer? so as to know that this script in your computer work or not???


Report this post
Top
 Profile Send private message E-mail  
Reply with quote  
 Post subject: how to output substrfunction
PostPosted: Thu Jul 28, 2011 2:53 am 
Offline
I've been banned!
I've been banned!
Rookie (I'm probably spamming)
Rookie (I'm probably spamming)

Joined: Wed Jun 01, 2011 5:06 pm
Posts: 5
Location: Finland
Points: 50
i have a system which is it using asp language but the problem is i need to convert the system to php language..and i need help ..i dont know how to convert them..


Report this post
Top
 Profile Send private message E-mail  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Registered users: No registered users


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Portal » Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
[
SEO MOD © 2007 StarTrekGuide ]