421
jmass
Re: MySql Catch22 - Please Advise
  • 2004/2/18 16:46

  • jmass

  • Friend of XOOPS

  • Posts: 524

  • Since: 2003/12/18


Mithrandir.... You are the MAN!!!

Thanks!

JMass



422
jmass
Re: MySql Catch22 - Please Advise
  • 2004/2/18 16:44

  • jmass

  • Friend of XOOPS

  • Posts: 524

  • Since: 2003/12/18


I tried to make this work... Could you give me a syntax example?

Thanks,

JMass



423
jmass
MySql Catch22 - Please Advise
  • 2004/2/18 16:11

  • jmass

  • Friend of XOOPS

  • Posts: 524

  • Since: 2003/12/18


Hello!

I am inserting a record into a MySQL table called ticketdata that has one unique id field - TicketID (int auto increment)

After I insert it, I would like to automaticly insert another record into a different table called updatedata. This table has its own unique id field - UpdateID (int auto increment) but also has a field ParentTicketID to link it to Ticket record.

How can I insert a new Ticket record, and then immediatly insert an Update record, when I do not know the ParentTicketID?

Any help would be appreciated!

JMass



424
jmass
Re: Web Standards and Xoops Themeing Framework
  • 2004/2/18 15:50

  • jmass

  • Friend of XOOPS

  • Posts: 524

  • Since: 2003/12/18


I love CSS, but the big push to CSS LAYOUT kinda bothers me.

The last two static sites I built were table free. A good example of one is McTevia & Associates. It was the right thing to do for these sites, and helped to seperate the look and feel from content. Really I feel like CSS only sites are a kind of poor mans templating system. They help but are not nearly as powerful as a real templating system like Smarty

There has been so much effort to seperate model(content or data) from view(look and feel) via MVC and the like, that something else is often overlooked. The seperation of look and feel from layout (esentialy dividing the View component of MVC into seperate pieces). The HUGE advantage of a templating system like Smarty is the seperation of the View (look and feel from layout), as well as the Model from the View.

Smarty does not have to use tables. You could build Smarty templates only in CSS. This has some advantages, but also some disadvangates.

The bulk of code already coded with tables in Smarty for XOOPS indicates that is is not going total CSS any time soon. Nor should it. There is very little to be gained from doing so right now.

That being said, if you are designing a new module you could make all of you templates in CSS only(table free). There is nothing stoping you.

JMass



425
jmass
Re: Inserting data into module table
  • 2004/2/16 17:45

  • jmass

  • Friend of XOOPS

  • Posts: 524

  • Since: 2003/12/18


WooooooooHoooooooo!

Thanks again everyone!

The MySQL debug was just the trick. I had an error in my table creation. It works now.

Thanks again!!!!

JMass



426
jmass
Re: Inserting data into module table
  • 2004/2/16 17:30

  • jmass

  • Friend of XOOPS

  • Posts: 524

  • Since: 2003/12/18


Again thanks for the posts.

I do have global $xoopsDB; ( I know what you mean about forgetting the obvious)

I found the MySQL debug... I am trying ti out now.

Thanks,

JMass



427
jmass
Re: Inserting data into module table
  • 2004/2/16 14:53

  • jmass

  • Friend of XOOPS

  • Posts: 524

  • Since: 2003/12/18


No Luck! Arghhhh!

This is my code:

$TicketID = '4';
$UID = $xoopsUser->getVar("uid");
$EntryDate = $_POST['entrydate'];
$ClientID = $_POST['clientid'];
$CategoryID = $_POST['categoryid'];
$PriorityID = $_POST['priorityid'];
$TicketSubject = $_POST['ticketsubject'];
$TicketDetails = $_POST['ticketdetails'];

echo $TicketID;
echo $UID;
echo $EntryDate;
echo $ClientID;
echo $CategoryID;
echo $PriorityID;
echo $TicketSubject;
echo $TicketDetails;


// SQL Assuming you took your _POST vars and assigned

$sql = "INSERT INTO ".$xoopsDB->prefix('obsclient_hd_ticketdata');
$sql .= " ( TicketID, UID, EntryDate, ClientID, CategoryID, PriorityID, TicketSubject, TicketDetails ) VALUES ";
$sql .= " ( '$TicketID', '$UID', '$EntryDate', '$ClientID', '$CategoryID', '$PriorityID', '$TicketSubject', '$TicketDetails' )";

echo $sql;

// run sql
if ( ! $xoopsDB->query($sql) )
{
echo( $xoopsDB->error." : ".$xoopsDB->errno );
}

All of the echo statement produce good results including to $sql - but still no insertion

the if statement produes a :

this indicates that the $xoopsDB->error and $xoopsDB->errno do not work either... Mabey I am missing a vital include?

JMass



428
jmass
Re: Inserting data into module table
  • 2004/2/16 12:23

  • jmass

  • Friend of XOOPS

  • Posts: 524

  • Since: 2003/12/18


Thanks for the post!
I had:
// SQL Assuming you took your _POST vars and assigned
// them to $value1, $value2 ect..

$sql = "INSERT INTO ".$xoopsDB->prefix('tablename');
$sql .= " ( field1, field2, field3 ) VALUES ";
$sql .= " ( '$value1', '$value2', '$value3' )";

But did not have this:
// run sql
if ( ! $xoopsDB->query($sql) )
{
echo( $xoopsDB->error." : ".$xoopsDB->errno );
}
I will give it a try and post results.

Thanks for the info. XOOPS has such a great community.

JMass



429
jmass
Re: Inserting data into module table
  • 2004/2/15 14:17

  • jmass

  • Friend of XOOPS

  • Posts: 524

  • Since: 2003/12/18


A MySQL Table.

It should be a very simple common thing to do... But I could not find the XOOPS way of doing it.

Thanks for replying.

JMass



430
jmass
Inserting data into module table
  • 2004/2/15 2:01

  • jmass

  • Friend of XOOPS

  • Posts: 524

  • Since: 2003/12/18


I am having a very tough time inserting data into a table of my module.

I am passing vars from a form via post. I can get the vars and echo them, but can not seem to insert them into my table.

Can anyone show me some sample code that illustrates how to d othis right? I have looked at the class files for news and such, but can't seem to figure this out.

Thanks,

JMass




TopTop
« 1 ... 40 41 42 (43) 44 45 »



Login

Who's Online

245 user(s) are online (135 user(s) are browsing Support Forums)


Members: 0


Guests: 245


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits