[thelist] help with project design

Terion Miller webdev.terion at gmail.com
Tue Nov 25 16:43:36 CST 2008


hi, can someone help me put this in the right order:
 $bDate = $_POST['bDate("date('Y-d-m')")'];
I have tried a few ways but keep getting syntax errors and can't find a post
anywhere on the order...

On Tue, Nov 25, 2008 at 4:21 PM, Abdullah Mancy <mancy3000 at gmail.com> wrote:

> LOL,  queries all about MySQL =) so,..  no trick for PHP here
> i'm off to bed,
> glad it works
>
> On Wed, Nov 26, 2008 at 12:17 AM, Terion Miller <webdev.terion at gmail.com
> >wrote:
>
> > OH wow it was a* ` *....jeeez php is tricky tricky
> >
> >
> > On Tue, Nov 25, 2008 at 4:11 PM, Abdullah Mancy <mancy3000 at gmail.com>
> > wrote:
> >
> > > every time i correct your query .. you damage it =)
> > > WRONG QUERY
> > >
> > > $query = "INSERT INTO 'textads'  (`ID`, `title`, `href`, `blurb`,
> > `bDate`,
> > > `eDate`, `expos`, `xCount`) VALUES ('$title', '$href', '$blurb',
> > '$bDate',
> > > '$eDate', '$expos')";
> > >
> > > you wrote 'textads'    instead write `textads`
> > >
> > > you put 8 columns  while you provided 6 values
> > >
> > > you put ID which is suppose to be auto_increment
> > >
> > > correct query would look like this
> > >
> > > $query = "INSERT INTO `textads`  (`title`, `href`, `blurb`, `bDate`,
> > > `eDate`, `expos`) VALUES ('$title', '$href', '$blurb', '$bDate',
> > > '$eDate', '$expos')";
> > >
> > > MAKE SURE OF THE LETTER CASE FOR THE VARIABLES
> > >
> > >
> > >
> > >
> > > On Wed, Nov 26, 2008 at 12:09 AM, Terion Miller <
> webdev.terion at gmail.com
> > > >wrote:
> > >
> > > > Oh thank you, now step 1 down...can you explain why that one worked
> as
> > > > opposed to the others, I'm trying to learn this stuff but everything
> is
> > > so
> > > > greek to me...or maybe that should be geek to me lol
> > > >
> > > > On Tue, Nov 25, 2008 at 4:02 PM, Abdullah Mancy <mancy3000 at gmail.com
> >
> > > > wrote:
> > > >
> > > > > this would really work =)
> > > > >
> > > > >
> > > > >
> > > > > <?php
> > > > > if(isset($_POST['add']))
> > > > > {
> > > > >  include 'inc/dbconnOpen.php';
> > > > >  $HREF = $_POST['HREF'];
> > > > >  $TITLE = $_POST['TITLE'];
> > > > >  $BLURB = $_POST['BLURB'];
> > > > >
> > > > >   $query = "INSERT INTO `textads`  (`title`, `href`, `blurb`)
> VALUES
> > > > > ('$TITLE', '$HREF', '$BLURB')";
> > > > > echo $query;
> > > > >   mysql_query($query) or die('Error, friggin insert query failed');
> > > > >  echo "New Dream Job Text Ad  added";
> > > > > }
> > > > > else
> > > > > {
> > > > > ?>
> > > > > <form action="" method="post">
> > > > > <table width="400" border="0" cellspacing="1" cellpadding="2">
> > > > > <tr>
> > > > > <td width="100">TITLE</td>
> > > > > <td><input name="TITLE" type="text" id="title"></td>
> > > > > </tr>
> > > > > <tr>
> > > > > <td width="100">Blurb</td>
> > > > > <td><input name="BLURB" type="text" id="blurb"></td>
> > > > > </tr>
> > > > > <tr>
> > > > > <td width="100">LINK</td>
> > > > > <td><input name="HREF" type="text" id="href"></td>
> > > > > </tr>
> > > > >
> > > > >
> > > > > <tr>
> > > > > <td width="100">&nbsp;</td>
> > > > > <td><input name="add" type="submit" id="add" value="Add AD"></td>
> > > > > </tr>
> > > > > </table>
> > > > > </form>
> > > > > <?php
> > > > > }
> > > > > ?>
> > > > > </body>
> > > > > </html>
> > > > >
> > > > >
> > > > > On Tue, Nov 25, 2008 at 11:58 PM, Terion Miller <
> > > webdev.terion at gmail.com
> > > > > >wrote:
> > > > >
> > > > > > Nope still get a blank page with that...
> > > > > >
> > > > > >
> > > > > > On Tue, Nov 25, 2008 at 3:52 PM, Abdullah Mancy <
> > mancy3000 at gmail.com
> > > >
> > > > > > wrote:
> > > > > >
> > > > > > > here is correction to my code i was missing column value into
> the
> > > > > insert
> > > > > > > query
> > > > > > >
> > > > > > > <?
> > > > > > > $items = array('HREF'=>'link',' TITLE'=>'title','
> > > > > > > BLURB'=>'text','BDATE'=>'beginning date','EDATE'=>'end
> > > > > > date','EXPOS'=>'');
> > > > > > > foreach($items as $item => $message)
> > > > > > > {
> > > > > > >  if(isset($_POST[$item]))
> > > > > > >  {
> > > > > > >    $$item = $_POST[$item];
> > > > > > >  }
> > > > > > >  else
> > > > > > >  {
> > > > > > >    $$item = "";
> > > > > > >    $errormsg = "Please Select " . $message . " for the AD.";
> > > > > > >  }
> > > > > > > }
> > > > > > > mysql_select_db($mysql);
> > > > > > >
> > > > > > > $sql = "INSERT INTO textads (HREF, TITLE,
> > BLURB,BDATE,EDATE,EXPOS)
> > > > > VALUES
> > > > > > > ('$HREF','$TITLE', '$BLURB', '$BDATE', '$EDATE', '$EXPOS')";
> > > > > > > mysql_query($sql) or die('Error, insert query failed');
> > > > > > >
> > > > > > > ?>
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > On Tue, Nov 25, 2008 at 11:49 PM, Abdullah Mancy <
> > > > mancy3000 at gmail.com
> > > > > > > >wrote:
> > > > > > >
> > > > > > > > oh sorrychange $query line to
> > > > > > > >
> > > > > > > > $query = "INSERT INTO `textads` (HREF, BLURB, TITLE) VALUES
> > > > > > > > ('$HREF','$TITLE','$BLURB')";
> > > > > > > >
> > > > > > > >
> > > > > > > > On Tue, Nov 25, 2008 at 11:48 PM, Abdullah Mancy <
> > > > > mancy3000 at gmail.com
> > > > > > > >wrote:
> > > > > > > >
> > > > > > > >> change $query line to
> > > > > > > >>
> > > > > > > >> $query = "INSERT INTO 'textads' ('HREF', 'BLURB', 'TITLE')
> > > VALUES
> > > > > > > >> ('$HREF','$TITLE','$BLURB')";
> > > > > > > >>
> > > > > > > >>
> > > > > > > >
> > > > > > > --
> > > > > > >
> > > > > > > * * Please support the community that supports you.  * *
> > > > > > > http://evolt.org/help_support_evolt/
> > > > > > >
> > > > > > > For unsubscribe and other options, including the Tip Harvester
> > > > > > > and archives of thelist go to: http://lists.evolt.org
> > > > > > > Workers of the Web, evolt !
> > > > > > >
> > > > > > --
> > > > > >
> > > > > > * * Please support the community that supports you.  * *
> > > > > > http://evolt.org/help_support_evolt/
> > > > > >
> > > > > > For unsubscribe and other options, including the Tip Harvester
> > > > > > and archives of thelist go to: http://lists.evolt.org
> > > > > > Workers of the Web, evolt !
> > > > > >
> > > > > --
> > > > >
> > > > > * * Please support the community that supports you.  * *
> > > > > http://evolt.org/help_support_evolt/
> > > > >
> > > > > For unsubscribe and other options, including the Tip Harvester
> > > > > and archives of thelist go to: http://lists.evolt.org
> > > > > Workers of the Web, evolt !
> > > > >
> > > > --
> > > >
> > > > * * Please support the community that supports you.  * *
> > > > http://evolt.org/help_support_evolt/
> > > >
> > > > For unsubscribe and other options, including the Tip Harvester
> > > > and archives of thelist go to: http://lists.evolt.org
> > > > Workers of the Web, evolt !
> > > >
> > > --
> > >
> > > * * Please support the community that supports you.  * *
> > > http://evolt.org/help_support_evolt/
> > >
> > > For unsubscribe and other options, including the Tip Harvester
> > > and archives of thelist go to: http://lists.evolt.org
> > > Workers of the Web, evolt !
> > >
> > --
> >
> > * * Please support the community that supports you.  * *
> > http://evolt.org/help_support_evolt/
> >
> > For unsubscribe and other options, including the Tip Harvester
> > and archives of thelist go to: http://lists.evolt.org
> > Workers of the Web, evolt !
> >
> --
>
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
>



More information about the thelist mailing list