473,408 Members | 1,982 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Sent data truncated?

Hi,

I can't send data over to another page, if the data has spaces in-between,
eg.

$row[0] = "Garden Party by the Sea" and i use the following code:

<a href=deleterecord.php?id=$row[0]&tablename=$tablename>$row[0]</a>";

then what is sent over is
$row[0]="Garden
and $tablename is not sent over at all.

How can i send over the complete $row[0] plus another variable to the next
page?

TIA
Mar 7 '06 #1
2 1506
no*****@st.peters says...
I can't send data over to another page, if the data has spaces in-between,
eg.

$row[0] = "Garden Party by the Sea" and i use the following code:

<a href=deleterecord.php?id=$row[0]&tablename=$tablename>$row[0]</a>";

then what is sent over is
$row[0]="Garden
and $tablename is not sent over at all.

How can i send over the complete $row[0] plus another variable to the next
page?


This is not a PHP thing, it's a HTML thing. HTML property references (like
href and value) which are not enclosed in double quotes will break at the
first whitespace.

Try using escaped quotes (/"):
$link="<a href=/"deleterecord.php?id=$row[0]&tablename=$tablename/">$row
[0]</a>";

or I prefer to use single-quotes and concatenators for PHP and double-
quotes only for the HTML bits:

$link='<a href="deleterecord.php?id='.$row[0].'&tablename='.
$tablename.'">'.$row[0].'</a>';

Although the fact that you have such text in an "id" field indicates poor
design.

Geoff M
Mar 7 '06 #2
Hi Geoff,

Thanks. It worked after i changed it to \"

i agree that it is poor db design, by using such variable data as primary
key. But my purpose is to create a general method for anyone to create any
table with any number of fields of their own choice, and no assumption is
made regarding their knowledge of db design.

All they have to do is live with what they have created. :-)

cheers
"Geoff Muldoon" <ge***********@trap.gmail.com> wrote in message
news:MP************************@news.readfreenews. net...
no*****@st.peters says...
I can't send data over to another page, if the data has spaces
in-between,
eg.

$row[0] = "Garden Party by the Sea" and i use the following code:

<a href=deleterecord.php?id=$row[0]&tablename=$tablename>$row[0]</a>";

then what is sent over is
$row[0]="Garden
and $tablename is not sent over at all.

How can i send over the complete $row[0] plus another variable to the
next
page?


This is not a PHP thing, it's a HTML thing. HTML property references (like
href and value) which are not enclosed in double quotes will break at the
first whitespace.

Try using escaped quotes (/"):
$link="<a href=/"deleterecord.php?id=$row[0]&tablename=$tablename/">$row
[0]</a>";

or I prefer to use single-quotes and concatenators for PHP and double-
quotes only for the HTML bits:

$link='<a href="deleterecord.php?id='.$row[0].'&tablename='.
$tablename.'">'.$row[0].'</a>';

Although the fact that you have such text in an "id" field indicates poor
design.

Geoff M

Mar 7 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Redd | last post by:
The following is a technical report on a data modeling project that was recently assigned to me by my professor. I post it so that anyone else who is studying databases and data modeling can have...
2
by: john.livermore | last post by:
Quick question about deleting data from SQL Server. We have a table that gets quite a bit of activity with an attribute of type text (inserts that store new text entries of 50-200k apiece)....
5
by: uthuras | last post by:
Machine : AIX 5.2 Product : UDB DB2 Release 8.1 FP4a I have problem loading data into destination table. The data file is huge with more than 6 Million records. This what i have done 1....
1
by: Andrew Arace | last post by:
I scoured the groups for some hands on code to perform the menial task of exporting table data from an Access 2000 database to Oracle database (in this case, it was oracle 8i but i'm assuming this...
11
by: Fernando Barsoba | last post by:
Hi all, I very much need your help here guys.. I'm working on a IPSec implementation, and when almost finished, I found a considerable problem. I'm sending a particular array + a key to a...
0
by: David A. Schramm | last post by:
I am using OLE DB in .NET 2 to insert a row into an Access database. The source is a RTF control and the column is a Memo field. The data is being truncated along the way. The control's rtf...
5
by: Alan Pretre | last post by:
In VS 2003 when I use the Configure Data Adapter option in VS 2003 I get the size parameter to the SqlParameter set to the correct size for a varchar, for example, .... new...
0
by: Grip | last post by:
Hi, I have gone throught the group and Microsoft's online help and have seen many suggestions but I am still seeking clarity: 1. I have an excel spreadsheet. Column A contains text that may...
7
Coldfire
by: Coldfire | last post by:
i am having error ....details are ASP.Net application...in which I have a textbox <asp:TextBox ID="Other" TextMode=SingleLine CssClass="serviceBox" Width="250" Height="45" Runat="server"...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.