DB Error: 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 2

SELECT * FROM `user` the_table WHERE the_table.userid = DB Error: 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 2

SELECT * FROM `user` the_table WHERE the_table.userid = perl programming? - iTechForums
Login
Search
Welcome to the iTechForums.
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
To register now click here.
Latest Threads
Advertisements
Forum Statistics
Threads:
Posts: 3
Members:
Number of Users Online:
Welcome to our newest member,
Reply
 
Thread Tools Display Modes
  #1  
Old 05-15-2008, 12:15 AM
ArnArn ArnArn is offline
Junior Member
 
Join Date: May 2008
Posts: 24
Default

perl programming?


Sample Data:
<tocelement name="New classification and
<tocelement name="Gestational diabetes mellitus
<tocelement name="Glycohaemoglobin: a
1997" ca= "ANZ"
<tocelement name="The prevention
<tocelement name="Diabetes and
</tocdivision>

Program:
while (<TEMP1>)
{
$CountTB=substr $_,0,1;
print $CountTB;
if ($CountTB eq "<")
{
print TEMP2 $_;
}
else
{
print "OK";
print "\b", TEMP2 $_;
}
}

Problem:
I want the " 1997......" to be in 1 line before it. Meaning all lines must first start with "<" since the file is an xml. how am i gonna do it. i have a sample program but everytime i ran it, it stops at the sntence " 1997......" please help????

Correct output i want:
<tocelement name="New classification and
<tocelement name="Gestational diabetes mellitus
<tocelement name="Glycohaemoglobin: a 1997" ca= "ANZ"
<tocelement name="The prevention
<tocelement name="Diabetes and
</tocdivision>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 05-15-2008, 12:25 AM
martinthurn martinthurn is offline
Junior Member
 
Join Date: May 2008
Posts: 25
Default

Can you just delete all \n when not immediately followed by < ?

undef $/;
my $sAll = <TEMP1>;
$sAll =~ s/\n([^<])/$1/g;
print TEMP2 $sAll;
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
perl programming??? ArnArn Perl 1 05-10-2008 08:03 AM
Perl ....how to write it correctly with Perl ?!? viki k Perl 0 05-06-2008 04:40 PM
Perl Programming? espanolstudent Perl 1 05-06-2008 01:46 PM
Delphi programming help? duffman Delphi & Kylix 0 05-06-2008 10:15 AM
Perl programming??? ArnArn Perl 0 05-06-2008 09:32 AM

Your Ad Here

All times are GMT. The time now is 01:31 AM.