Jump to content
xisto Community
Sign in to follow this  
Houdini

Some Problems Sometimes On Other Sites! Others come up with wierd problems

Recommended Posts

I am not the most regular contributer to PHP Builder but every now and then there is just a question from a newbie or someone that can not be fixed. I do not know if it is that they do not know how to ask the question but this one has been going on too long.

It seemed from the question that they asked that they wanted to insert some data froma text file into the MySQL database. So after looking at their query (the original question)

Here's part of my code:
Code:

$result = mysql_query("INSERT INTO AL_BVA (contact, time, phone, address, city, state, zip, email, website, notes) VALUES ('$contact',NOW(),'$phone','$address','$city','$state','$zip','$email','$website','$notes')",$connect); echo "<b>Form updated.</b>";



I'd like to use "include", or anything that works, to replace the "(contact..." and "('$contact',..." parts so they can be updated from one file.

I've used .txt files for the other parts I needed to update from an external file but I can't seem to get the right code for these two... I desperately need this to work.

Thanks in advance!



I deduced that what they really wanted to do was

That would probably be used asPHP Code:
LOAD DATA INFILE "datafilename" INTO TABLE tablename

See Load Data

More posts went by and I got disgusted, either because I do not know what they want to do, and am not a mind reader but an escape artist (I have been known to even disappear) what other method of doing what you saw quoted would help the poor soul, 'cause I don't know?

Share this post


Link to post
Share on other sites

do you have Macromedia DreamweaverMacromedia Dreamweaver have many php aplication that you can create just by some clicksone of them is insert/delete/ update in databasesi suggest you that use Macromedia Dreamweaver, if you are not the most regular contributer to PHP

Share this post


Link to post
Share on other sites

What I am talking about has nothing to do with using an editor that is WYSIWYG especially if it costs money, my PHP Designer 2006 works just fine for code development. The question posed by the user could not have been solved by using an editor, it needed someone to look at the objective and come up with a solution. Again here is the persons query;

I'd like to use "include", or anything that works, to replace the "(contact..." and "('$contact',..." parts so they can be updated from one file.

You don't use includes with MySQL so no editor in the world will make that happen. They were using the wrong logic about what they actually wanted to do. If the purpose was to place a large amout of data into a field in this case the contact field (column if you prefer) was to use the SQL of LOAD DATA INFILE "datafilename" INTO TABLE tablename which is a far cry from an INSERT or UPDATE query. This was actually more of a MySQL question than a PHP question although you could use PHP to perform the query, I haven't checked back because I and another member suggested the same approach but the user that posed the question seemed to have something different in mind (I think).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.