![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Inserting records from flat file to db table | Hara | Shell Programming and Scripting | 4 | 12-27-2006 03:35 AM |
| inserting into a data file | paul1s | UNIX for Dummies Questions & Answers | 4 | 10-13-2006 02:47 AM |
| Inserting Values From A File Into A Table | ragha81 | Shell Programming and Scripting | 2 | 09-16-2006 07:10 PM |
| Editing a mySQL table on a remote machine | Sn33R | UNIX for Dummies Questions & Answers | 6 | 10-14-2003 01:47 AM |
| MySql: create table error | perleo | Shell Programming and Scripting | 3 | 04-16-2003 05:23 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Help Inserting data in mysql table
Cant understand the error
#!/bin/bash temp="" A="" D=$(date +"%Y-%m-%d") H=$(date +"%R") temp=$(wget -q -O - website | grep -o "Temperature:[[:space:]]*[0-9][0-9]*" | grep \-E -o "[0-9]+") mysql -D "weather_wise" -e "INSERT INTO weather (Date, Hour, Degrees) VALUES ($D,$H, $temp)"; my data types for Date an Hour are both date Im getting error below i think on $D and $H......Please help me where am i going wrong ERROR 1064 (42000) at line 1: 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 ':39, 7)' at line 1 |
|
||||
|
i have tried that but same error though
|
|
||||
|
I found this page with a explanation how to insert dates in mysql, hope this helps:
MySQL Tutorial - Date Regards |
|
||||
|
Quote:
would you know how to limit time to only hour and minute? |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|