Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





INSERT Short Record = Fine, Long One Isnt


I have a mysql database table that I created by copying another one in phpadmin. The first table works fine. the second table works fine when I insert a short record, but when I do a long one it doesn't appear in the database. any idea what I'm doing wrong? It's not that its truncating the record, there is nothing there.




View Complete Forum Thread with Replies

Related Forum Messages:
Safely Cut Off Short Preview Version Of Long String
Here`s a problem I have been working on for a while, but can`t seem to
solve satisfactory.

I have a database with blog entries. Because each of those entries has a
variable length which can be quite long, I want to build an overview page.
Of each entry there will be a preview version, say 700 characters max.

My problem has to do with HTML tags. If for example an entry contains a
<BLOCKQUOTE> with a large quote, my function would break off somewhere
halfway in the quote. The end result of course won`t have the
</BLOCKQUOTE>, rendering the resulting page horribly bad.

I would like to build a function that breaks a string up to max X
characters long, but plays it safe when it encounters any HTML tag: it
does not matter if the end result is a string of say 670 characters long,
it only matters that it approximates the max character setting and doesn`t
mess up the HTML tags.

View Replies !
INSERT Code Isnt Working.
This probably has a really simple answer, but my INSERT code isnt working.

mysql_query('INSERT INTO `members`
(`id`, `uname`, `uemail`, `upass`, `GUID`, `data`, `permissions`)
VALUES ('NULL', $psuser, $psemail, $psPassword, 'NULL', 'NULL', &#391;')');
And I get an error saying
unexpected T_STRING .

View Replies !
Long Insert
I need to update a table in mysql and the information is very long. I changed it to Longtext and whenever i use php to update it, the query returns true but the data never gets inserted into the database. Here is an example of the text that would be entered: Code:

View Replies !
Insert Long String
I'd like to send a long string to my database instantly - i.e. not passing it to the next page, retrieving variables and then inserting. So I pretty much want to know how the "Submit" button works at the bottom of this thread I'm posting. (I did try to make sense of the back end!). The long string may incorporate line breaks, I presume this just means I need to set the column type as Memo in the database?

View Replies !
Create One Long Insert Statement Based On The Values In The Array.
I current have an array called $hole[]. the code is as follows:

$x=1;
$round_detail_string = "";
foreach ($hole as $value){
$round_detail_string += '(null,"'.$x.'","'.$value.'"),'
}

I am trying to create one long insert statement based on the values in the array.

View Replies !
Cannot Insert Record
I have this problem where, on my pc at home with apache and sql, when testing my site on my home pc with apache and sql, everything is fine, but when i posted it on the net, none of the add records work, the files get sent, but no record inserted in my database. Strange.. Code:

View Replies !
Cannot Insert A Record?
I am so confused for those code which didn't allow me to add a record into database "surpro". Code:

View Replies !
Insert Record Duplication
I have written and re-written code and always the same results. When I insert a new record, it duplicates. The code is below, followed by my simple database structure. For brevity, only 4 fields are listed, but that's all that is in my current test model, which I've taken down to "bare bones".

I have set up the same database from scratch on two different servers with two different versions of MySQL and PHP, and had the same results. I have written this code several different ways, as well as separating the HTML and the PHP processing into two separate files, all still with the same results. PHP Code:

View Replies !
How To: Send Email Upon Insert Of Record.
I have a small and modest scheduling web app that I wrote using PHP (v.3) and MySQL. I would like to add the feature of emailing one or multiple accounts whenever a record is added to a table - tblSchedule. The server that my app runs on supports PHP 3 and 4, MySQL, and Sendmail I believe.

View Replies !
Insert New Record To Database Without Duplicating
Is there a simple way when inserting a new record to a database to only execute if it is not duplicating an existing record? The way I would currently do this is to query the database first with the new values and see if I get a match, but is there simpler way?

View Replies !
Can't Insert Record Into Access Database
I'm trying to create a registration/login script using Access 2003. I'm using ADOdb to connect through ODBC.

The problem is that I get the little custom error Could Not Connect to Server when I try to insert a record, yet when I use the form with a username I inserted through Access it reads it just fine and returns if the username has been used. Also if I removed line line 23 or die('<b>Could Not Connect to Server</b>'); and it'll complete the script, but it won't insert the record. Code:

View Replies !
Retrieving A Record Atfer Insert
Is there any way that you can retieve a value from a record that you have just inserted into mysql database. I am inserting a record and have a auto number column. What I need to do is get that number after I have inserted the new record and then echo it out onto the screen.

View Replies !
Data Duplication When Insert A New Record
i have 2 php pages, 1.php and 2.php . the 1.php simply contains a form and would be submitted to 2.php. the page 2.php then INSERTs the form data into the database. but , if the user Refreshes the page or simply back to the 2.php by BROWSER'S BACK Button , the data would Insert Again into the DB . Code:

View Replies !
Insert Double Quotation Record
i want to insert or update a record to mysql. content of text filed has some " character (they are html codes: <table dir="ltr" .... >) when i want to add normal it doesn't work
PHP Code:

$sqlquery = "INSERT INTO static VALUES('$content')";
$results = mysql_query($sqlquery);

but when i use of $content=addslashes($content); before this code it works success but when i view the content of record before all " characters there is character ( all " converted to ") (<table dir="ltr" ... )

mysql_real_escape_string() works like addslashes() too

i dont want add anything before " characters when i view record.

View Replies !
Duplicate Entry - Insert A Record To My Database
When I am trying to insert a record to my database I get this error: Duplicate entry ?' for key 1

but when I check my database from phpMyAdmin I dont have any record with this ID. show me 17866 for Next Autoindex in Row Statistics section too. What's the problem?

View Replies !
Create A Query That Will Insert Each Size Into 1 Record
Seeking some help on a site i'm working on. Our company acquired a software for order processing we do. I am in the midst of trying to format it somewhat and i'm coming across a situation i'm not familiar with. In this code, there is a loop statement that adds the quantity of SM, MD, LG, 1X, 2X and 3x and displays a grand total. I am needing to create a query that will insert each size into 1 record, sorta like this:

Record1: Qty, BaseID, CustomText, Size,Price, Extended Price

THis will need to be done with each size that the user has added to the cart.I am not displaying any info now, as i am unser what is needed but if someone can point me in the right direction, it will be greatly appreciated. I will post whatever code is needed.



View Replies !
How To Insert Record In Database Using Text-area
i need to insert record using textarea. but this is not working. my function for insert is function InsertRecord($fieldarray) Code:

View Replies !
Special Characters - Insert A Record Into A MySQL Database
I'm trying to insert a record into a mySQL database from PHP. The field on the database is of "Blob" type, and the data i'm trying to enter contains a single quote. I'm using this string to enter the data.... PHP Code:

View Replies !
MySQL INSERT Command Adding A Blank Record
I have a form that I am INSERTing into the MySQL database. I have the names and vaules set. The columns header is the same but when I "submit" the form it adds a blank record to the database. If I add another one, another blank record is added. Code:

View Replies !
How Long Is Too Long For A Script To Execute? GetTimer()
I'm using some scripts and they're executing from

.007 - .010

It defines many files, imports several files (total of maybe 20), encrypts 2 strings several times base64 IN flash, WWW-Authenticating to a PHP file, PHP grabs a MySQL Query, returns it, traces it.

That happens all in .007 seconds roughly. How long is too long until you should find a new script. If a script runs with a time of .05, is that the general limit or is that fast?

View Replies !
Sends The E-mail Ok, But It Isnt Cc'ing ?
Sends the e-mail ok, but it isnt Cc'ing ?

View Replies !
Why Mysql Isnt Connecting
trying to get php to connect with mysql so that I can start querying db(running locally on my machine and php works fine) however I'm having trouble. This is the error it spits out-

Warning: mysql_connect(): Access denied for user 'ODBC'@'localhost' (using password: NO) in D:phpwebconnect.php on line 5

Unable to connect to MySQL

Could anyone assist me on this matter.

View Replies !
Strtotime And Dates Long Long Ago ...
while making an encyclopdie on my hometown (dutch,
http://www.kgv.nl/index.php?id=610) i am trying to use dates prior to
1970. birthdates in, let's say, 1615.

i'm getting errors while working with these dates, for example when i am
calculating which day of the week it is. the dates are stored in a
mysql database.

is there another way to convert stringtype dates to work with?

View Replies !
How To Make A "sophisticated" Insert Record Form ?
I have a DB with many inter-related tables (MySQL)
My main table called "content" has almost only foreign keys (integers)
some have a 3 level relation (ex: content->city->region->country)

I would like admins to be able to insert new records including all the
"content" fields (in 1 page form)

But how can I make an insert form that would display the related
tables as list menus instead of a textfield with a number? (ex: select
country from a drop down menu instead of typing the foerign key
number)

Main content Table:
IDRef = primary key
IDLocation = foreign key --related to tables city->region->country
IDDescription = foreign key --related to table Description (=several
big and small text fields)
IDImages = foreign key --related to image (=image and thumbs path, alt
text, etc..)

Do you know any tutorial, help or solution ?

View Replies !
Insert The Entire Record From TBL_CO Where DIGIPASS=$digipass Into TBL_DIGIPASS
I have one mysql Db with 2 tables consisting each having the same columns.
Now I want to insert the entire record from TBL_CO where DIGIPASS=$digipass
into TBL_DIGIPASS Code:

View Replies !
Isnt ^ Common Regex Notation?
isnt ^ common regex notation?

keep getting this error:
Parse error: syntax error, unexpected '^'

Code:

$goalsheet.=preg_replace("/^[0-9]+ Year Career Goal #[0-9]+: *$", "/^<span class=hd2>[0-9]+ Year Career Goal #[0-9]+: *</span><br>$/", $goallist);

aside from the error, i think the regex is off, but i hav had a hard time finding a tutorial that explains how I can ignore text in the middle. Here are some examples of what i'm trying to do:

"1 Year Goal #1: Web Developer" -> "<span>1 Year Goal #1: Web Developer</span><br>"
"10 Year Goal #2: IT Consultant" -> "<span>10 Year Goal #2: IT Consultant</span><br>"

suggestions?

View Replies !
How Do Sessions Work Cos Mine Isnt Working?
How do sessions work cos mine isnt working i got this:

on a different page i have :
$_SESSION['referer'] = '1';
then:
if ($_SESSION['referer'] == '1'){
include ("include.php");
}

but when i echo session it is blank =/ what did i do wrong.. i got many other sessions on the go so it should work..

View Replies !
How To Connect To Database Server That Isnt On 'localhost'
how to connect to database server that isnt on 'localhost'. are you suppose to replace 'localhost' with the ip address? i keep on getting a 'connect to error. could not find/connect to database'.

View Replies !
Script Isnt Pulling The Basename From Upload
This upload script im using for some reason wont pull the file name and database it when you go to upload a file and it wont upload the file either... I used this script before and got it to work but for some reason it wont work now.. I checked the other forms and they still work so i must be missing something in the script. Code:

View Replies !
Simple Image Upload Isnt Working?
im working on a simple image upload script (my first try) well i noticed that for some reason its not even recognizing a file being uploaded...ive tried using the phpfreaks simple image upload tutorial but that wont seem to work for me. Code:

View Replies !
Security Code Image In PHPNuke Login Isnt Displaying
i installed the PHP Nuke in a remote web space bought from prackhost.Problem is that iam not able to get the security code to login to the site as admin or normal user. All the remaining images like links and logo are comming except that security code. Iam not able to do any furthur action.

View Replies !
PHP 5.0.5 Is Not Working Fine
I have downloaded the tar file of php5.0.5 from php.net,but when i am configuring it manually,its not working. i have seen the manual and was trying the way its described in it. i have included the path c:/php in enviroonment variables too, but when i use the IIS server and point it in the browser as http://localhost/project/info.php (project is my virtual directory in IIS), its not showing me anything.

View Replies !
How Long Is Too Long For A Cgi Script?
I have a 4000 line php cgi script that is not memory or cpu intensive.
It runs in 1 second. Now I am getting a lot of customer requests to add
in new features. My question is if there is a point where my code will
be too long and take too long to run (i.e > 5 seconds). I would really
like to have my script rival the functionality of a desktop application
but can php do it?
My server is a dual processor with 2GB ram.

View Replies !
Session Don't Works Fine
I've got my intranet running in a server with XP, apache and PHP. When i'm testing my apps, sessions work fine, but when I upload it to the server they don't work. My app checks users against Active Direcory and save some data to session variables. I show this variables in a frame and check some times if user is logged to show some info. Someone know's what's the matter with it?

View Replies !
Does Berkeley DB 4.3.28 Work Fine 4 ?
I want to use berkeley db with PHP 4. I have installed php extension of
berkeley DB on my linux machine.

However I m not able to create database with the help of those classes.
[ Please take a note that I am not in favor of using php inbuilt dbm
style functions as it does not allow to specify access mothods + not
fit in my requirements. Code:

View Replies !
File Upload Mac Os X Fine, Windows Xp Not ?
I've written a simple CMS (the file upload is handled by code I found here) for a site I'm working on and I thought everything was working ok until I tested it on a pc.

I always get the same error on the pc which is something I wrote so that only normal jpg's would be uploaded, not progressive jpgs (this is because the site has a flash front end and flash can't load in progressive jpg's dynamically).

I added some more error checking in the php file, and a very strange thing is occuring. I have tried uploading the EXACT same jpg from both my mac and pc, on the mac it uploads fine, resizes etc etc but on the pc it doesn't and in my error message it says that the file is a 'image/pjpeg'? Does a pc think a normal jpg is a prgressive jpg ??? How can the jpg change file types? this is really weird!

View Replies !
Installation Went Fine But Code Won't Work
I followed it to a "t" but now when testing simple php page the php script does not run. Simple php script i am using is Code:

View Replies !
Login Script That Checks Long Long It Has Been Since A Last Login
i need to make a login script that checks long long it has been since a last login. I have Mysql so i can use that to store the last login date. Can someone help me figure out how to find how many days ahve passed since a previous login. Like what format should the last loin date be stored in. Also how i get it to figure out how many days have passed since the last login.

View Replies !
Session Counter Won't Increment But Registered Fine?
I eagerly started the devshed tutorial on sessions and discovered I cannot get the simple counter script to work. I have read a bunch of other posts and I am still not exactly sure why things aren't working. I have the session directory set in php.ini, I have cookies enabled in my browser.

Here are two files which I have changed around in various ways, paying attention to putting the session_register in different spots.

View Replies !
Mail() Function Always Works Fine, But Hangs.
Just the simplest invocation with hard coded parameters, followed
by echoing a message, hangs for exactly 1 minute. ("defaulttimeout"
in php.ini is set to 30 (seconds)). If I don't wait, and immediately
hit the browser's "stop" button I get that "transfer interrupted"
message, but the email still gets sent and received just fine.
Sendmail is not running, "sendmail_path" is not set in php.ini, and
the email headers look as if the email was sent from the command line
using /bin/mail.

View Replies !
Script Repeat Updates The Record And Also Inserts Another Record With The Same Information.
I have a form which contains some fields that are populated with data from a table. This same form also has fields that are empty because the data has not been collected yet. The main table is called client with a primary key of client_id. What I need to do with this form is select the client and update the record into a new table with the missing information. If the client doesn't not exist in this second table, I need to insert the row otherwise if the client does exist in this table because of a previous update, update the record.

When I run my script, the insert works. When I try to run the script again and try to update the record, the script not only updates the record but also inserts another record with the same information. How can I write my script so it checks whether a client exists in a table and if it does, update the record and if the client does not exist in the table, add the client?

View Replies !
How To Securely Store A Record Index When Editing A Mysql Record
is there a secure way
to do this? the non-secure ways are, as i understand it, to populate
a listbox with indices as names, or maybe use a hidden control. is the
only secure way with sessions? i was also thinking about perhaps
creating a meta table that says who is editing which record right
now. any advice?

View Replies !
Isset($_REQUEST['var']) Works Fine On One Server But Not On Another
The isset($_REQUEST['var']) works okay on other servers but not on
mine. The way the application works is the links are provided as:

http://url.com/cc.php?page=currencies&new

And then in cc.php the code is

if isset($_REQUEST['new']) {
...
}

The problem is with the above code it sees new as not set and the if
statement isn't exectuted. The same code on other servers works OK.

If I change the url to:
http://url.com/cc.php?page=currencies&new=
or
http://url.com/cc.php?page=currencies&new=something

Then the isset($_REQUEST['new']) will be true.

Is there any setting in my php config to make php see 'new' variable
as set as I've shown in the first url in this message?

View Replies !
Checkbox Array Passes To Script Fine But Doesn't Mail Right
I'm starting to get a little ticked off because I've worked for
hours on this and I can't seem to find the cause. I'm using PHP 5.1.6.
I'm trying to get the values of some form checkboxes along with another
fixed variable and pass them along in an email. For demonstration
purposes, I have checked the Wed and Fri checkboxes and set the time for
9:00 am.

<FORM ACTION="test.php" METHOD=POST>
<TABLE border="1" width="70%" >
<TR>
<td><input type="checkbox" name="NewClass[]" value="Mon" size="5"
maxlength="2"</td>
<td><input type="checkbox" name="NewClass[]" value="Tue" size="5"
maxlength="2"</td>
<td><input type="checkbox" name="NewClass[]" value="Wed" size="5"
maxlength="2"</td>
<td><input type="checkbox" name="NewClass[]" value="Thu" size="5"
maxlength="2"</td>
<td><input type="checkbox" name="NewClass[]" value="Fri" size="5"
maxlength="2"</td>
<td><input type="checkbox" name="NewClass[]" value="Sat" size="5"
maxlength="2"</td>
<td><input type="checkbox" name="NewClass[]" value="Sun" size="5"
maxlength="2"</td>
<TD><input type="text" name="NewClass-Time" size="5" maxlength="10"></TD>
</TR>
</TABLE>
<input type="submit" name="ClassList" value="Submit Survey Info"
class="button">
</form>

When I print out print_r($_POST);, I get everything passed correctly as:

Array
(
[NewClass] =Array
(
[0] =Wed
[1] =Fri
)

[NewClass-Time] =9:00 am
)

But when it gets emailed, the results listed on the email I get are as
follows:

NewClass: Array

NewClass-Time: 9:00 am

I stripped the processing script down to the barest of essentials. All
that's on it right now is:

foreach($_POST as $key =>
$value){if(!(!isset($value))){$set=1;}$message = $message . "$key:
$value

";} if($set!==1){header("location: $_SERVER[HTTP_REFERER]");exit;}

$message = stripslashes($message);

$headers = "From: " . $_POST['name'] . " <" .$_POST['email'] . ">
" .
"Return-Path: " . $_POST['email'] . "
" . "Reply-To: " .
$_POST['email'] . "
";

mail($my_email,$subject,$message,$headers);

View Replies !
Works Fine On Home Server But Not On Hosting Package!
He the following code works on my apache machine but not on my purchased webspace! it gives the error ... Error, insert query failed ....

View Replies !
Counter Works Fine But Just Checked The W3c Validation Site
I have just built my first website but have added a couple of php scripts (include files) for a counter etc (until I can write my own).

My site is in xhtml 1.0 transitional and the counter works fine but just checked the w3c validation site and it shows errors against my line 129 which is as follows:

<div id="counter"> <span class="countertext">you are visitor</span>
<?php include("counter.php");?>
<span class="countertext"> thank you.</span> </div>

My question is this: If php is a server side language why do I get xhtml errors. I take it the errors are in the counter.php file.

View Replies !
Folders Permisson To 777 Internal Server Error But 755 Is Fine
I set a folders permisson to 777 then when I try to run a .php file I get an "http 500 internal server error." If I set the folders permisson to 755 then they run fine.

View Replies !
Have A Website Running In IIS Which Works Fine Except Can't Connect To Mysql
what I can do to fix this error? 

Call to undefined function mysqli_connect() in C:Inetpubwwwrootemail_username.php on line

I have these extensions enabled:

extension=php_mysql.dll
extension=php_mysqli.dll

I am not sure what else to do?"?

View Replies !
Compare Record With Session Variable And Update Record If Different
I'm trying to figure out how to create a session variable from a recordset field value in a mySQL database and compare this with subsequent values from the same field each time the page reloads. When the value of the field changes (as a result of a user update) I want to trigger an event (redirecting to another page). It's probably a very basic PHP function but I am a newbie with this language.


View Replies !
Has Anyone Had Problems With IE Not Showing Thumbnailed Gifs When Firefox And NN Show Them Fine?
Wondering if anyone else has had problems with gifs created by php or if

anyone sees a problem with this code.

Symptom: created jpegs work fine and created gifs work fine in Netscape and

Firefox and when directly viewed.

IE displays gif fine *via internet* BUT off of a CD or local HTML file it

won't display the file.

function thumbnail ($src_file, $path) {
$orig = $path . '/' . $src_file;
list($w,$h,$type) = getimagesize($orig);
if ($type == 2) { // jpeg
$src_img = imagecreatefromjpeg("$orig");
$name = "thmb_" . $src_file;
$thmb_and_path = $path . $name;
if(!file_exists($thmb_and_path)) {
$image_info = getimagesize($orig);
$src_width = $image_info[0];
$src_height = $image_info[1];
$dest_height= 80;
$dest_width = ($dest_height/$src_height) * $src_width;
$quality = 30;
$dst_img = imagecreatetruecolor($dest_width,$dest_height);
imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $dest_width,
$dest_height, $src_width, $src_height);
imagejpeg($dst_img, $thmb_and_path, $quality);
chmod("$thmb_and_path", 0777);
imagedestroy($src_img);
imagedestroy($dst_img);
}
} else if ($type == 1) { // gif
$src_img = imagecreatefromgif("$orig");
$name = "thmb_" . $src_file;
$thmb_and_path = $path . $name;
if(!file_exists($thmb_and_path)) {
$image_info = getimagesize($orig);
$src_width = $image_info[0];
$src_height = $image_info[1];
$dest_height= 80;
$dest_width = ($dest_height/$src_height) * $src_width;
$quality = 30;
$dst_img = imagecreatetruecolor($dest_width,$dest_height);
imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $dest_width,
$dest_height, $src_width, $src_height);
imagejpeg($dst_img, $thmb_and_path, $quality);
chmod("$thmb_and_path", 0777);
imagedestroy($src_img);
imagedestroy($dst_img);
}
}
return $thmb_and_path;
}

View Replies !
Get A Very Short Url?
i have a very annoying problem and the php programmers that are working on the site cannot find a way to have a very short url. i am trying to get my website running but a few problems are on the way and it really slows me down,i am going to host an mp3 website(legal mp3) where the unsinged musician can upload their musics,on all the website i have looked at on the net,the artist can choose his url ending ,how do the sites manage to do this??i understand it is something to do with a rewritting rule..but how?is there a trick somewhere?

here is the problem:
if you have an url like this for example:
http://www.mysite.com/store/files/public/artist_band_name

how can i get to this:
http://www.mysite.com/artist_band_name

every sites i have been on have this feature is it something realy really hard to do?

View Replies !
Value Cut Short
I want to pass results from db query into textfield. However,for the spin_offs it is passed in as this:

<input type="checkbox" name="file[]" id="file[]" value="spin_of,test" />

Why is the end fs cut off?

PHP Code:

$query = "SELECT 'mergers' AS tbl, name FROM centralised_archive.mergers ".
         "UNION SELECT 'rights' AS tbl, name FROM centralised_archive.rights ".
         "UNION SELECT 'spin_offs' AS tbl, name FROM centralised_archive.spin_offs ".
         "UNION SELECT 'splits' AS tbl, name FROM centralised_archive.splits ".
                 "UNION SELECT 'mergers' AS tbl, name FROM mergers ".
         "UNION SELECT 'rights' AS tbl, name FROM rights ".
         "UNION SELECT 'spin_offs' AS tbl, name FROM spin_offs ".
         "UNION SELECT 'splits' AS tbl, name FROM splits";

$result = mysql_query($query) or die(mysql_error());

while ($row = mysql_fetch_array($result))
{    
   echo '<tr><td><input type="checkbox" name="file[]" id="file[]" value="' . $row['tbl'] . ',' . $row['name'].'" /></td><td>'.$row['name'].'</td></tr>'
}

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved