Jump to content

mysql query question


karimali831

Recommended Posts

Hi

 

I'm trying to add a 1on1 column to my cup_matches table and insert value "1" if ID in the cups table has value "1" in the 1on1 column or insert value "0" if ID in the cups table has value "0" in the 1on1 column. See attatchments to help.

 

I believe there is something wrong with my code:

 

<?php
$getid=safe_query("SELECT cupID FROM ".PREFIX."cup_matches");
while($ds=mysql_fetch_array($getid)) $cupID = $ds['cupID'];

$is1on1=safe_query("SELECT 1on1 FROM ".PREFIX."cups WHERE ID='$cupID'");
$dl=mysql_fetch_array($is1on1);

mysql_query("ALTER TABLE `".PREFIX."cup_matches`
if($is1on1($cupID))   ADD `1on1` INT( 11 ) NOT NULL default '1' AFTER `einspruch`,
else                     ADD `1on1` INT( 11 ) NOT NULL default '0' AFTER `einspruch`;") 

OR die(PREFIX.'cup_matches <font color="red">failed!</font><br> You have already updated to V4.1.4b!<br />'); 
echo '<center><h2>Successfully updated to V4.1.4b!</h2><br><a href="index.php"><b>View Site</b></a></center>'; 
?>

 

Any help I'll appreciate, thank you.

 

[attachment deleted by admin]

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.