db_num_rows and drupal_goto question

Maybe someone can help me. I created a form with and within my submit function below I have 3 possible outcomes: 1) item not-found, not authorized to create, 2) item not-found, authorized to create and 3) item found go to it.

I got the first 2 working with the exception of my drupal_set_message. I am trying to push back what was entered in the form but all i get is Array. Thats question 1.

Second, my last option (item found) I thought I could get to using else and drupal_goto($form_values); - I get a db_nums error. Any ideas?

<?php
// take form value and lookup company table for nid
function tickersearch_form_submit($form_id, $form_values) {
$results = db_fetch_object(db_query("SELECT nid FROM {node_content_company} WHERE field_ticker_value = '%s'", $form_values));
if (user_access('create content_company content') && (db_num_rows($results) == 0)) {
drupal_set_message(t('The ticker %name was not found. Please check your entry or add this company to the database.',
array('%name' => $form_values)));

drupal_goto('node/add/content_company');
}
if (!user_access('create content_company content') && (db_num_rows($results) == 0)) {
drupal_set_message(t('The ticker %name was not found. Please send IRP an email with instructions to add the company to the database.',
array('%name' => $form_values)));

drupal_goto('ticker');

need help with upgrade - lost files

i tried to upgrade from 4.7. to 5.1 and saved my database anf 4.7 files but forgot to deactivate all these modules. 5.1. didint work and the 4.7 on server was deleted. when I tried to reinstall 4.7 I found out that my previous saving was incomplete (modules left) and so the reinstallation was not possible.
Can anybody help me to reinstall my page or new 5.1?
thanks
inherence

Gmap Maps not showing?

Is anyone else having problems with Gmap Maps not showing? I noticed several other Drupal-based sites using the Gmap module weren't displaying their maps today - including the site of Webgeer who I think did a lot of the development of this module - http://www.webgeer.com/map/user.

How to have a common user login for everyone ?

I am using quiz module which is not working for guests hence I am looking to introduce a common ID like "poster" with password as drupal123 so that anyone can login and take the quizzes. But I need to make sure that people don't edit the password by going to My Account. I am exploring access control, have created a new role as well but I can't see how can I stop ppl changing the password

Any help ?

Displaying Related Forum topics just like VB at the bottom ?

I want to display related forum topics below forum threads just like in VB. How can I do this ? I am having some problem with related links module so that is not an option.

I liked what has been done here http://www.gerd-riesselmann.net/archives/2005/11/display-related-nodes-i... but it is not working. It seems this code only works for Node content type and nor for forum. Any suggestion to make it work for forum ?

any other hacks/suggestions ?

user warning: Table <some table> doesn't exist query - What is going wrong with the module ?

Ok, I am using related links module on my site and you can first see the errors on one of the page at - http://www.money-faq.com/why-are-there-two-different-interest-rates-for-...

Now the Cause - I installed relatedlinks, than uninstalled it. Than manually deleted its two tables nodelist and nodelist_tracker. Now after repeatedly trying, the tables are not getting created. Surprisingly you can see that the blocks that the module created are still showing related links below the page even though the table don't exist.

Anyway Now how to created the tables again ? I have tried to run the sql commands of .install file but they are giving errors. Can someone tell me how to create tables. Here is the full .install file of related links


<?php
// $Id: relatedlinks.install,v 1.18 2006/11/13 21:47:34 karthik Exp $

/**
* Implementation of hook_install().
*/
function relatedlinks_install() {
$ret = array();

switch ($GLOBALS['db_type']) {
case 'mysqli':
case 'mysql':
db_query("CREATE TABLE {relatedlinks} (
lid int(11) unsigned NOT NULL auto_increment,
nid int(11) unsigned NOT NULL default 0,
url varchar(255) NOT NULL default '',
title varchar(255) default NULL,
type tinyint(4) unsigned NOT NULL default 1,
PRIMARY KEY (lid),
KEY nid (nid),

Pages

Subscribe with RSS Subscribe to RSS - Drupal 4.7.x