NYCPHP Meetup

NYPHP.org

[nycphp-talk] Help Request

LY heli_travel at yahoo.com
Sat May 18 11:02:03 EDT 2002


it looks like the update format is not right. ig.
    ===set KEYWORD1 = \\"$keyword1\\",=== 
when it goes to db, it will be 
   ***  set  KEYWORD1 = "XXXXXXX"       ****, 
I don't know MySql, but I guess it will cause a db error,
because the correct sytax for set it could be 
  ++++  set  KEYWORD1 = 'XXXXX', +++++
so I suggest you to use this 
  $$$$ set  KEYWORD1 = '".$keyword1."',  $$$$$
to try for some db fields which need to be quoted by ''.
for fields are numbers, you just do like this:
  %%%% set  NUMBERFIELD = $number, %%%%%

Hope this help you,Good Luck!
Mark J








--- Jerry Wing <jwing at www.erols.com> wrote:
> I am developing for myself a database application that carries
> job
> related information for the internet - my own small business. 
> I have
> developed scripts for adding and deleting a record, but the
> script for
> update record does not work.  The add record script adds
> values to all
> the fields of a record, and the delete record script deletes
> whatever
> record is selected.  I think the database columns are okay
> since they
> work with these two commands.
> 
> The script for the update record consists of three separate
> scripts. The
> first script selects the record to be modified.  The second
> script
> displays the fields of the record on the screen.  The third
> script does
> the modification with the UPDATE statement.
> 
> The script that selects the record and the script that
> displays the
> field information for the record work fine.. the script that
> modifies
> the records does not.
> 
> I copied the script from PHP Essentials, written by Julie
> Meloni.
> 
> If someone would be willing to work one on one to look at the
> three
> scripts (record selection, record display, and record
> modification, i
> would greatly appreciate it.....I would like to e-mail them to
> you as i
> do not have a server to post them on, or I can send them by
> icq or
> irc.... here is the third script that is not working (i get no
> error
> message... apparently it is executing but--------:
> 
> <?php
> If ($var2=="Return To Admin Home Page"){
>         header("Location:index.htm");
>         exit;
> }elseif ($var1=="Modify Database"){
> 
>                 $connection = mysql_connect("localhost",
> "jwing",
> "xxxxxxxx")
>                         or die ("Couldn't connect to
> server.");
>                 
> 
>                 $db = mysql_select_db("jwing", $connection)
>                         or die ("Couldn't select database.");
> 
> $sql = "update jobs 
> set 
> KEYWORD1 = \\"$keyword1\\",
> KEYWORD2 = \\"$keyword2\\",
> KEYWORD3 = \\"$keyword3\\",
> KEYWORD4 = \\"$keyword4\\",
> KEYWORD5 = \\"$keyword5\\",
> COMP_ID = \\"$comp_id\\",
> SHOW_DATE = \\"$show_date\\",
> JOB_CAT = \\"$job_cat\\",
> JOB_LOC = \\"$job_loc\\",
> JOB_TITLE = \\"$job_title\\",
> JOB_DESC = \\"$job_desc\\",
> JOB_SALARY = \\"$job_salary\\",
> FIRST_NAME = \\"$first_name\\",
> LAST_NAME = \\"$last_name\\",
> AD_EMAIL = \\"$ad_email\\",
> CNTCT_EMAIL = \\"$cntct_email\\",
> USR_NAME = \\"$usr_name\\",
> P_WORD = \\"$p_word\\",
> AD_PHONE = \\"$ad_phone\\",
> CNTCT_PHONE = \\"$cntct_phone\\",
> AD_FAXPHONE = \\"$ad_faxphone\\",
> WEB_SITE = \\"$web_site\\",
> CCNAME = \\"$ccname\\",
> CCNUMBER = \\"$ccnumber\\",
> MONTHEXP = \\"$monthexp\\",
> YEAREXP = \\"$yearexp\\",
> CCTYPE = \\"$cctype\\",
> STREET1A = \\"$street1A\\",
> STREET2A = \\"$street2A\\",
> STREET3A = \\"$street3A\\",
> CC_CITY = \\"$cc_city\\",
> CC_STATE = \\"$cc_state\\",
> CC_ZIP = \\"$cc_zip\\",
> TRBLFONE = \\"$trblfone\\"
> where job_id = \\"$job_id\\"";
> 
> $sql_result = mysql_query($sql) or die (mysql_error());
> echo "
> <HTML>
> <HEAD>
> <TITLE></TITLE>
> </HEAD>
> <BODY background=\\"rimmabg.jpg\\">
> <FORM METHOD=\\"POST\\" ACTION=\\"jl2s1s.php\\">
> 
> <input name=\\"var1\\" value=\\"Return To Admin Home Page\\"
> Type=\\"submit\\">
> 
> </form>
> </BODY>
> </HTML>
> ";
> };
> ?>
> 


__________________________________________________
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com



More information about the talk mailing list