![]() |
Sergey Kornilov admin 10/13/2010 |
You forgetting to add single quotes around text values in SQL Query. |
K
|
karmacomposer author 10/14/2010 |
You forgetting to add single quotes around text values in SQL Query. See this for a reference: http://www.webcheatsheet.com/sql/interactive_sql_tutorial/sql_insert.php
|
![]() |
Sergey Kornilov admin 10/14/2010 |
Here is your current query: |
K
|
karmacomposer author 10/14/2010 |
Here is your current query: INSERT INTO RecruiterNames (RecruiterID, CompName) values (26,Mfelkerco) It should be this way: INSERT INTO RecruiterNames (RecruiterID, CompName) values (26,'Mfelkerco') Unfortunately you cannot guess the syntax. You need to understand exactly what you doing. Btw, using DAL can save you a few gray hair. http://xlinesoft.com/phprunner/docs/data_access_layer.htm Check Add() function.
|
K
|
karmacomposer author 10/14/2010 |
I really want to thank the support staff for what I consider to be excellent support thus far. |
K
|
karmacomposer author 10/15/2010 |
global $dal; |
K
|
karmacomposer author 10/15/2010 |
On the off chance that it may work, I tried the following: |
![]() |
Sergey Kornilov admin 10/15/2010 |
Mike, |
K
|
karmacomposer author 10/15/2010 |
Mike, you already have all what you need. Look back at your SQL-based code where you access values of table fields.
|
K
|
karmacomposer author 10/15/2010 |
Mike, you already have all what you need. Look back at your SQL-based code where you access values of table fields.
|
T
|
tedwilder 10/16/2010 |
Great, but that does me no good. I need, now, to tell the code block to access the other table and extract the two fields I need
|
K
|
karmacomposer author 10/16/2010 |
Thank you for your answer. TBH, I would like to do this in DAL so that I can replicate it for other tasks. |
K
|
karmacomposer author 10/16/2010 |
Okay, I now have no errors and it is writing to table RecruiterNames, but no actual data. Here is my code: |
K
|
karmacomposer author 10/16/2010 |
hello. well if you remeber this topic : http://www.asprunner.com/forums/topic/15454-query-a-table-for-data/ it's just what you need : you access the other table , and extract 2 fileds sql="select * from thetablenameyouneed where somefield=".$_Session["somefield"]; $rs=CustomQuery($sql); $datafromtheothertable=db_fetch_array($rs); you will get in $datafromtheothertable["field1"] and $datafromtheothertabl["field2"] THEN you insert data in the first table. you have so far extracted the 2 fields you need. just insert them : global $conn,$strRecruiters; $strSQLSave = "INSERT INTO RecruiterNames (RecruiterID, CompName) values ("; $strSQLSave .= $datafromtheothertable["field1"].","; $strSQLSave .= $datafromtheothertable["field2"]; $strSQLSave .= ")"; db_exec($strSQLSave,$conn); that is just the idea of what you should do. (sorry i dont know how to use dal ). but try with phpmyadmin or navicat lite ( free) your sql statemetn before coding it with variable. that will sapre you lot of time.
|
D
|
Dale 10/16/2010 |
$_Session try $_SESSION |
K
|
karmacomposer author 10/16/2010 |
$_Session try $_SESSION
|
K
|
karmacomposer author 10/16/2010 |
OK, now I have that fixed - I had to duplicate the table in PHPMyAdmin and then make all necessary edits in PHPRunner and upload. |
K
|
karmacomposer author 10/17/2010 |
OK. I put that code along with $_SESSION in place in PHPRunner at AFTER RECORD UPDATED on both ADD and EDIT and I get the following error: |
K
|
karmacomposer author 10/17/2010 |
I found some errors and made the changes 0. include/dbconnection.php:36 db_query 1. INSERT INTO RecruiterNames (RecruiterID,RecName) values (27,Mfelkerco);
|
T
|
tedwilder 10/17/2010 |
|
T
|
tedwilder 10/17/2010 |
query INSERT INTO RecruiterNames (RecruiterID,RecName) values (27,Mfelkerco)
|
K
|
karmacomposer author 10/17/2010 |
Nevermind |
K
|
karmacomposer author 10/17/2010 |
Thank you so much. |