Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Web Design & Development Web Design & Development
Search Search
Search for:
Tech Support Guy > > >

Undefined index...


(!)

JiminSA's Avatar
JiminSA   (Jim) JiminSA is offline
Computer Specs
Member with 1,734 posts.
THREAD STARTER
 
Join Date: Dec 2011
Location: Johannesburg South Africa
Experience: Intermediate
12-Jul-2012, 10:00 AM #16
Ha-ha! I'm also glad!
Perhaps you might help me with a quick question - I'm setting up the db using the vehicles.dat file and hit a small prob...
can I use php data variables in the insert statement? Like this...
PHP Code:
mysql_select_db("surfwhee_vehicles"$con);

foreach (
$vehicles["vehicles"] as $id => $vehicles)
{
    
$count+=1;
    echo 
"Count: " $count;
    
mysql_query("INSERT INTO webentry 
    (datetime, fullname, phone, cell, suburb, make, model, year, kms, colour, extras, servhist, accidents, settlement, finhouse, monthsrem, monthsarr, amtrem, price, comments, tprice, rprice, natis, pics4, wcdisc, aprice, status, notes, agent, datetimestamp)
    VALUES 
    (
$vehicles['datetime'], $vehicles['fame'], $vehicles['phone'], $vehicles['cell'], $vehicles['suburb'], $vehicles['make'], $vehicles['model'], $vehicles['year'], $vehicles['kms'], $vehicles['colour'], $vehicles['extras'], $vehicles['servhist'], $vehicles['accidents'], $vehicles['settlement'], $vehicles['finhouse'], $vehicles['monthsrem'], $vehicles['monthsarr'], $vehicles['amtrem'], $vehicles['price'], $vehicles['comments'], $vehicles['tprice'], $vehicles['rprice'], $vehicles['natis'], $vehicles['pics4'], $vehicles['wcdisc'], $vehicles['aprice'], $vehicles['status'], $vehicles['notes'], 'Jim', date())");
}

mysql_close($con); 
And yet another quessy...
I created the db using the server ControlPanel software (phpMyAdmin) and half expected to pick up the localhost MySql directory in FileZilla, but haven't. Is there any way that I can? (I would like to download it to xampp)
__________________
"I expect to pass through this world but once. Any good, therefore, that I can do or any kindness I can show to any fellow creature, let me do it now. Let me not defer or neglect it for I shall not pass this way again."
http://bespoke-webwork.com
allnodcoms's Avatar
allnodcoms   (Danny) allnodcoms is offline
Computer Specs
Member with 610 posts.
 
Join Date: Jun 2007
Location: Hertfordshire - England
Experience: Advanced
12-Jul-2012, 11:17 AM #17
Sorry Jim, was watching the cycling... Yes, you can use PHP variables, but you drop the single quotes -$vehicles['datetime'] would become $vehicles[datetime]... No idea why, it's just the way it is.

You made the DB with phpMyAdmin on your remote server and want to download it to localhost? Your control panel has an export option which lets you save not only the DB data, but also the SQL code necessary to create the whole thing again somewhere else. Just export your DB and import it locally, it'll all be there waiting for you. Did I mention this was easy?

Danny
__________________
"An Apple a day keeps the Gatesy at bay"
JiminSA's Avatar
JiminSA   (Jim) JiminSA is offline
Computer Specs
Member with 1,734 posts.
THREAD STARTER
 
Join Date: Dec 2011
Location: Johannesburg South Africa
Experience: Intermediate
12-Jul-2012, 12:15 PM #18
You did mate! Easy-peasy as Oliver might say - thanks ol' mate 'specially for the quotes thing - I'd a been going in circles otherwise...
__________________
"I expect to pass through this world but once. Any good, therefore, that I can do or any kindness I can show to any fellow creature, let me do it now. Let me not defer or neglect it for I shall not pass this way again."
http://bespoke-webwork.com
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
WELCOME TO TECH SUPPORT GUY!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.


Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Forum Jump

WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑