11
rpclarke
Can't delete record from database.
  • 2004/12/9 6:56

  • rpclarke

  • Just popping in

  • Posts: 28

  • Since: 2004/11/6


Hey guys...

I have a module that I am making that uses a database to record information. I am trying to delete one row out of the database through the input the administrator of the module.

The SQL is correct, but in the MySQL debug pop-up window it shows this:

Error message: Database update not allowed during processing of a GET request

I am not sure what is happening here, is it a GET request as in the getting of variables? Or a previous access of the database?

How do I fix this?

Thanks!



12
rpclarke
Re: Dev: Database access
  • 2004/11/29 23:30

  • rpclarke

  • Just popping in

  • Posts: 28

  • Since: 2004/11/6


Ok I redid the SQL statement again, and this time it works. *pulls hair out*

$sql = "SELECT `charid`,`character` FROM `xoops_ffxi_manager` WHERE `charid` = 1";

Is the statement I used. picky picky.

Thanks Mith for trying to help me out with this, it is much appreciated!

Is there a configuration for mySql in linux to make it not need the ` in statements?



13
rpclarke
Re: Dev: Database access
  • 2004/11/29 23:21

  • rpclarke

  • Just popping in

  • Posts: 28

  • Since: 2004/11/6


I just made the table XOOPS installable using .sql files and editing the version file for the module. So the table installs itself now in the module administration. Still no data coming from the array....



14
rpclarke
Re: Dev: Database access
  • 2004/11/29 22:20

  • rpclarke

  • Just popping in

  • Posts: 28

  • Since: 2004/11/6


Yeah I put the == in there as part of testing things... I have it removed still doesnt work.

Put in your first function, I get

string(6) "member" bool(false)

I put in your second functino, I get

resource(132) of type (mysql result)



15
rpclarke
Re: Dev: Database access
  • 2004/11/29 22:16

  • rpclarke

  • Just popping in

  • Posts: 28

  • Since: 2004/11/6


One thing to note, I manually put the table in the database if that makes any difference. Trying different things, I know that the function call works, I can put a dummy value in no problem..... And a dummy value in that array position works as well. So its definately something database related.. bleh.



16
rpclarke
Re: Dev: Database access
  • 2004/11/29 22:07

  • rpclarke

  • Just popping in

  • Posts: 28

  • Since: 2004/11/6


Tried that... Still nada... heres the code so far..

functions.php

<?php

// FFXI Linkshell manager Functions.php File

function getMembers() {
global $xoopsDB;
$value = array();
$member = array();
$sql = "SELECT * FROM ".$xoopsDB->prefix("ffxi_manager")." WHERE 'charid' = 1";
$dbresult = $xoopsDB->query($sql);
$member = $xoopsDB->fetchArray($dbresult);
$value["charid"] == $member["charid"];
$value["character"] == $member["character"];
echo "value is=".$member["character"];
return $value;
}

?>

index.php - portion of;

$roster = getMembers();
echo "||X:".$roster["character"];

the echo in both php files doesnt output the array contents.

I ran the SQL statement in phpmyadmin and it pulls the right info there...... Its just not getting to the array or not pulling it out of the database.. but the debug shows it working..

Heres the output from the popup window;

SELECT * FROM xoops_ffxi_manager WHERE 'charid' = 1



17
rpclarke
Re: Dev: Database access
  • 2004/11/29 21:46

  • rpclarke

  • Just popping in

  • Posts: 28

  • Since: 2004/11/6


I get this error:
Warning [PHP]: opendir(/srv/www/htdocs/cod/modules/myMembers/images/imagesets/): failed to open dir: No such file or directory in file modules/newbb/include/vars.php line 45
Notice [PHP]: Undefined variable: xoopsModuleConfig in file modules/newbb/include/vars.php line 46

But seems unrelated;

On the SQL:

There was an error with the SQL so I fixed the SQL query:

$sql = "SELECT 'ID', 'character' FROM ".$xoopsDB->prefix("ffxi_manager")." WHERE 'ID' = 1";

Just had to add the single quotations around the fields.

No errors on SQL now, but still no data being output...

Thanks for the info on the debug modes.. very useful that.



18
rpclarke
Dev: Database access
  • 2004/11/29 21:20

  • rpclarke

  • Just popping in

  • Posts: 28

  • Since: 2004/11/6


I am making a module similar to Mith's team module, which I have been combing through for a guild website for Final Fantasy XI.

I have created a table in the database with 1 line of information, and now I am trying to pull that information out of the database for display on a template.

Using the functions I have found, I should be able to pull information out of the database for display, but I am not getting any result.

Do I have to put information in somewhere before XOOPS will use that table in the database?

in my functions.php I have this;

function getMembers() {
global $xoopsDB;
$value = array();
$sql = "SELECT ID, character FROM ".$xoopsDB->prefix("ffxi_manager")." WHERE ID = 1";
$dbresult = $xoopsDB->query($sql);
$member = $xoopsDB->fetchArray($dbresult);
$value["ID"] = $member["ID"];
$value["character"] = $member["character"];
return $value;
}

And in my index.php I use this;

$roster = getMembers();
echo "||X:".$roster["character"]; // Testing Purposes

Of course the echo is just a temporary thing just to see if its retrieving database information, which it is not..

In the database the field character is a VARCHAR field, and ID is a INT field with auto_increment on.

I hope thats all the info you need... Thanks for the advice..



19
rpclarke
Re: Module Dev Forge
  • 2004/11/29 21:10

  • rpclarke

  • Just popping in

  • Posts: 28

  • Since: 2004/11/6


Fair enough.

At this point I don't want a project anyways which was why I didnt put alot of detail, because 1) its a work in progress 2) I really don't want to share my ugly code since I am doing testing and design first based on a rough design doc in my head.

So I will ask my database question here in a new topic then, because I can't find any of the info for that in the design wiki.

Sorry if I came across harsh, it just seems to be the usual issue where you have beginners on one side of the fence in a pen segregated from the experienced people who don't want to help the beginners out of the pen when it comes to their playground.

I didn't want to post questions where they didn't belong since this side of things is orientated to the use and operation of xoops...

Anyhow, my apologies..

Thanks.



20
rpclarke
Re: Module Dev Forge
  • 2004/11/29 20:38

  • rpclarke

  • Just popping in

  • Posts: 28

  • Since: 2004/11/6


There is nothing stopping you from letting the forums be viewed publically but not let anyone post at the very least.

Currently I am going through other peoples code, but having an issue with database integration. You could have a "beginners" development forum on the main XOOPS website..

I can understand wanting to filter out the "how do I install xoops" similar questions which is fair. So where is the person who is quite capable of setting up xoops, and can do some PHP programming and modification of various files supposed to go for help?

What about creating a "Beginners" Development project thats seperate from the rest of the community?

I wouldn't mind helping out the community, but I need a place to start and to learn more about XOOPS before I can be at a level where I can contribute to XOOPS. Right now I had plans for 4 XOOPS sites, 2 private, 1 commercial, 1 non-profit organisation. Isn't my beginning contribution in using your software is using it in the first place?

Where's the biscuit for attempting to customize my sites through modules and programming?

Anyhow like I said, I would love to contribute, but the bottom line is, that sometimes you have to take before you can give back.

Thanks 8)




TopTop
« 1 (2) 3 »



Login

Who's Online

136 user(s) are online (101 user(s) are browsing Support Forums)


Members: 0


Guests: 136


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